Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cosmetic replacement within list tag even when replace_cosmetic=False #38

Open
ifly6 opened this issue Sep 30, 2023 · 1 comment
Open

Comments

@ifly6
Copy link

ifly6 commented Sep 30, 2023

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
Copy link
Author

ifly6 commented Sep 30, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant