Skip to content

The corner case for smart emphasis and footnotes #493

@Totktonada

Description

@Totktonada

I meet corner case of using smart emphasis with the footnotes extension. Let’s consider example:

some text[^1]

[^1]:
    _emphasis works_

    _emphasis doesn't work_

The problem appears only with last footnote’s paragraph and when ending undescore is last symbol in the paragraph. As I know footnotes extension appends non-breaking space and a backreference at end of a last paragraph for each footnote. Smart emphasis does (?!\w) lookahead (by the way, it’s looks as equial to \b) after ending underscore, so non-breaking space, I guess, blocks regex from matching.

The example easy to fix by replacing underscores with stars or by disabling smart emphasis. However, I think, it’s good to be aware of weird corner cases. The issue is informational and has no much impact over me (I’m fallbacks to stars).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug report.extensionRelated to one or more of the included extensions.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions