JiLiZART / BBob

⚡️Blazing fast js bbcode parser, that transforms and parses bbcode to AST and transform it to HTML, React, Vue with plugin support in pure javascript, no dependencies
https://codepen.io/JiLiZART/full/vzMvpd
MIT License
166 stars 19 forks source link

Possible to stop parsing children if certain tag is encountered? #164

Closed joseph1125 closed 1 year ago

joseph1125 commented 1 year ago

Hi, thanks for the awesome library. However, I encountered this special use case, as the platform I'm working on allowed users to type programming code under [code] tag, if user enters anything BBCode alike under code tag, it is possible that the string is being parsed (Example as follows).

[code][align=left][b]avc[/b][/align][/code]

would be transpiled into

<pre><p style="text-align:left"><b>avc</b></p></pre>

while the expected result is

<pre>[align=left][b]avc[/b][/align]</pre>

I would like to ask if it is possible to instruct the parser to stop parsing children when certain tags are encountered.

JiLiZART commented 1 year ago

Yep, I think about this feature. And already have an issue for it. https://github.com/JiLiZART/BBob/issues/32

JiLiZART commented 1 year ago

With new lexer I can implement this feature :)

JiLiZART commented 1 year ago

You can track progress here https://github.com/JiLiZART/BBob/pull/165

joseph1125 commented 1 year ago

Many thanks, I would definitely check it out