Closed patrikpatrik closed 3 years ago
It's setup not to interpret HTML tags, so it'll change the <>'s into HTML entities.
@patorjk , Thank you for the quick response. Is there a way to interpret it with an option or anything?
No, it's not setup to allow both HTML and BBCode. You could try commenting out these two lines:
https://github.com/patorjk/Extendible-BBCode-Parser/blob/master/xbbcode.js#L740
But I'm not sure what the exact effects would be, plus you'd be allowing any HTML into the result, which isn't a good idea.
That's right. So what would be the proper way of doing this? Sanitizing the string of all html tags except for the bbcodes, then parsing accordingly, then add the tags afterwards using vanilla js or jQuery no?
That could work. Maybe replace <> with {}, run the bbcode parser, then swap back in the <>'s.
I might do that. Okay thank you.
For some reason when html tags are included in the string it doesn't seem to work properly.
For example if you had a string like "
The log is [color=brown][b] dirty[/b][/color]
"it doesnt seem to parse the tags right but the bbcode will go through, or the tags will parse correctly with html() but the bbcode is changed to something weird..