Skip to content

fixMarkup useBR: true removes HTML tag if it starts at index 0 of string #2529

Closed
@andrewQwer

Description

@andrewQwer

fixMarkup and highlightBlock methods with {useBR: true} break markup.

I noticed, that hljs.highlight(...) generates the following code:

"<span class="hljs-symbol">[Created By]</span>"

Then fixMarkup for this string generates the following:

"[Created By]</span>"

Just comment configure method call and you'll see the difference (console output provided as well)
https://jsfiddle.net/t1maqeb7/6/

I believe it should not break markup this way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions