s9e / TextFormatter

Text formatting library that supports BBCode, HTML and other markup via plugins. Handles emoticons, censors words, automatically embeds media and more.
MIT License
232 stars 36 forks source link

BBCode tag with content starting with : gets ignored when using Litedown #86

Closed beavis closed 6 years ago

beavis commented 6 years ago

Due to tag priority (I guess) whenever you use [TAG]:whatever[/TAG] the tag gets ignored because of litedown LinkReferences. This gets tricky when having aliases using :code: like emojis for example [quote]:+1:[/quote] displays nothing.

beavis commented 6 years ago

I could just change priority of litedown reference from -2 to 1 but not really sure of the collateral damage of this change, seems it breaks one test

JoshyPHP commented 6 years ago

I have updated the regular expression used to match link references to be more strict in what's accepted. It should eliminate most of those issues and make it hard for a BBCode to be accepted as a link reference. However, there are still edge cases that are particularly difficult to solve. Feel free to reopen this issue if you encounter one.

beavis commented 6 years ago

Much appreciated, thank you