Closed erayerdin closed 7 years ago
I don't understand - I see that you're adding custom formatters, but don't see the actual call to platform_parser.format
and the expected output, so I don't know if this is a bug with the library or not.
I am sorry, I just put testing results. It was a bit complicated (that I should have even give a couple of sources to demonstrate), so I wanted to put it simply. To demonstrate, I call the function as this:
parser.format("[g]4332") # which does not have a closing tag and supposed to return the same thing.
Instead, it acts like the string is valid and generates:
<a href="/g/4332/">#4332</a>
This is my problem, in short.
Tags are implicitly closed by the end of the text, so this is the expected behavior. There's even a test for it:
https://github.com/dcwatson/bbcode/blob/master/tests.py#L14
The idea is to be somewhat forgiving about unclosed tags, tags closed in the wrong order, etc. since bbcode is normally written by humans, who make mistakes :)
I use this module in my Django project as below:
Following generates unexpected output while it is not valid at all:
I want it to stay same. I could not find any valid option for Parser class in documentation.