defendtheweb / hackthis.co.uk

HackThis!!
http://www.hackthis.co.uk
Other
46 stars 55 forks source link

Updated bbcode.js #189

Open Amaterasu27 opened 8 years ago

Amaterasu27 commented 8 years ago

In PM, if you have some message with the [ code ] tag, it will break all the [ spoilers ] tags and they won't open when clicking on "Show spoiler" This problem is because of the first line of the function I deleted If the code find any 'pre.bbcode_code_body', it breaks the whole code, messing spoiler and youtube tags

dloser commented 8 years ago

To be a bit more specific: highlight.js is no longer included in extra_XXX.js, but there is still a hljs reference in the file. A [code] block in the source results in evaluation of hljs, which fails and stops the rest of the code from executing, breaking spoiler tags, but also previews and more.

lwward commented 8 years ago

A better solution would be to check if hljs is defined within the each loop - or to include highlight.js as @dloser suggests.