jordandelozier / wysibb

WYSIWYG BBcode editor
http://www.wysibb.com
246 stars 86 forks source link

Incorrect conversion of typed text "[foo][/foo]" to bbcode and back. #176

Open LapisSea opened 7 years ago

LapisSea commented 7 years ago

Hello, I have been playing with this wonderful editor and I was checking out how it handles special characters like <> and [] and I discovered that if you type [b][/b] as text it will not do anything to mark that peace of text as a "not bb code element" when converting to bbcode to protect itself from parsing that peace as an element. Now I fixed this with a simple htmlText.replace(/\[/b, "\\[").replace(/\]/b, "\\]") just before parsing html text to bbcode and vice-versa before parsing bbcode to html. Problematic text: image

No fix: image My fix: image