Skip to content

[Bug] No escaping for attributes causes errorsΒ #513

@zisra

Description

@zisra

I'm converting HTML to markdown, and when converting images with alt text that has "[" and "]" brackets surrounding it (see example), this fails to escape and fails to render using marked. Should there be a feature to escape the content of HTML attributes as well? Happy to submit a PR to fix this myself.

Example HTML:
<img src="figure.jpg" alt="[Image]">

Leads to:
![[Image]](figure.jpg)

Instead of:
![\[Image\]](figure.jpg)

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