Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inline styles within <pre>/<code> blocks should be ignored #103

Closed
chrispy-snps opened this issue Jan 13, 2024 · 2 comments · Fixed by #117
Closed

Inline styles within <pre>/<code> blocks should be ignored #103

chrispy-snps opened this issue Jan 13, 2024 · 2 comments · Fixed by #117

Comments

@chrispy-snps
Copy link
Collaborator

Markdown has no provision for inline styles within preformatted content (unless extensions/etc. are used).

However, inline styles are incorrectly applied within <code> and <pre> blocks (note the ** in these examples):

from markdownify import markdownify as md
md('<code><b>text</b></code>')    # > '`**text**`'
md('<pre><b>text</b></pre>')      # > '\n```\n**text**\n```\n'

and because content is interpreted literally in Markdown preformatted content, the extra styling characters are interpreted as literal content characters instead.

@chrispy-snps
Copy link
Collaborator Author

@AlexVonB - you seem to be the most recently active maintainer. If I contribute a pull request for this, can it be considered for inclusion in the next release?

I would also like to contribute fixes other reported issues in this project. Is there a way I can reach you to talk more about it?

@AlexVonB
Copy link
Collaborator

Hi @chrispy-snps , I just sent you an email to you work address! :)

jsm28 added a commit to jsm28/python-markdownify that referenced this issue Apr 3, 2024
The check used for this is analogous to that used to avoid escaping
potential markup characters inside such tags.

Fixes matthewwithanm#103
jsm28 added a commit to jsm28/python-markdownify that referenced this issue Apr 3, 2024
The check used for this is analogous to that used to avoid escaping
potential markup characters inside such tags.

Fixes matthewwithanm#103
AlexVonB added a commit that referenced this issue Apr 4, 2024
* Avoid inline styles inside `<code>` / `<pre>` conversion

The check used for this is analogous to that used to avoid escaping
potential markup characters inside such tags.

Fixes #103

---------

Co-authored-by: AlexVonB <AlexVonB@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants