Skip to content

attr_list breaks if the value contains braces, requires HTML-encoding them #1390

Closed
@iBug

Description

@iBug

This issue originated from squidfunk/mkdocs-material#6177 where I was exploring the "override copied text" feature.

The following code block breaks Markdown parsing:

``` { .c data-copy="int main() { return 0; }" }
Try copying me for some C code
```

It doesn't quite make sense to me as everything is already inside double quotes.

Instead, HTML-encoding the braces (and you can add newlines) solves the problem:

``` { .c data-copy="int main() {
  return 0;
&#125" }
Try copying me for some C code
```

Using HTML-encoding is not intuitive to most users. Maybe this could get changed to Python escapes?

Metadata

Metadata

Assignees

No one assigned

    Labels

    someday-maybeApproved low priority request.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions