Skip to content

Inline code incorrectly parses inner markdown syntax #10

Description

@dened

The parser currently processes and applies markdown styling (like italics from underscores _) to the content within an inline code block.

Image

Bug Description
Content inside backticks (e.g., ...) should be treated as a literal string and should not be parsed for any further markdown styles. However, the current implementation incorrectly applies styles like italics to parts of the code that contain characters like underscores.

Steps to Reproduce
Use a markdown string with an inline code block that contains underscores, for example:
markdown
This example is using package:flutter_md/flutter_md.dart.
Render this string using the MarkdownWidget.
Expected Behavior
The text package:flutter_md/flutter_md.dart should be rendered entirely in a monospace font, with no parts of it being italicized.

Actual Behavior
The parts of the string surrounded by underscores (e.g., _md/flutter_md) are incorrectly rendered in an italic font.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions