lepture/mistune

Custom Plugin - Why does detecting [[xxx]] work but [xxx] not?

michaelrampl opened this issue · 3 comments

See the following Example:

The pattern to detect an object of type [[xxx]]

PATTERN_XXX_DOUBLE = (
    r'\[\['
    r'xxx'
    r'\]\]'
)

will be recognized, but the other one for [xxx]

PATTERN_XXX_SINGLE = (
    r'\['
    r'xxx'
    r'\]'
)

won't. Why is this and how can this be avoided/fixed?

Because [xx] is link referrer. It is already defined in parsing links.

Is there somehow a way to overwrite this behavior?

Put the rule before link rule.