bbcode icon indicating copy to clipboard operation
bbcode copied to clipboard

Cosmetic replacement within list tag even when replace_cosmetic=False

Open ifly6 opened this issue 1 year ago • 1 comments

This should be an MVE:

>>> import bbcode
>>> p = bbcode.Parser(replace_cosmetic=False)
>>> p.format('[list=1][*](c)[/list]')
'<ol style="list-style-type:decimal;"><li>&copy;</li></ol>'

I think that whatever formatter is doing the substitution for list has replace_cosmetic set forced to true?

ifly6 avatar Sep 30 '23 20:09 ifly6

I think it's set through the constructor of TagOptions, which defaults to replace_cosmetic = True, because that keyword isn't set when the formatters are added to the parser in install_default_formatters

ifly6 avatar Sep 30 '23 20:09 ifly6