Skip to content

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

Closed

Description

@chrispy-snps

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.

Activity

  1. chrispy-snps commented on Jan 13, 2024

    @chrispy-snps
    CollaboratorAuthor

    @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?

  2. AlexVonB commented on Jan 14, 2024

    @AlexVonB
    Collaborator

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

  3. added 2 commits that reference this issue on Apr 3, 2024
    5d6db69
    7328754
  4. added a commit that references this issue on Apr 4, 2024
    2bd0772
  5. added a commit that references this issue on May 21, 2025
    ba7ddb8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions