-
Notifications
You must be signed in to change notification settings - Fork 55
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
Single element tags #22
Comments
Same for me, this is weird with [br] user has to write [br][/br] to avoid a xbbcode error. |
For what it's worth to future folks looking for standalone tag support, I did some pre-processing of the input to automatically add closing tags for any tags I knew were standalone tags. It's not as nice as native support, but for the size of bbcode I'm processing, it worked fine. I used the following regular expression to process all the standalone tags that are not in [code] blocks: RegExp('\[code\].\[\/code\]|\[('+'|'.join(tag_list)+')([ =][^\\]]?)?\]', 'gmi') And this code for processing those:
This is in a platform where most of the code is Python, but you can convert that to Javascript if needed. |
I simply looked for each tags key without an closing function, and made an simple replaceAll for each of them right after |
Tags like
[br]
or[hr]
or even ones that have attributes like[tag=value]
or[tag=value attribute=value]
. Are these not supported?The text was updated successfully, but these errors were encountered: