dominch / redmine_highlightjs

A redmine plugin to highlight code blocks much better than coderay!
Other
22 stars 10 forks source link

Fix highlighting xml/html code by escaping html characters #30

Open anton-sergeev opened 7 years ago

anton-sergeev commented 7 years ago

Here is bug, no escape html characters: redmine_highlightjs bug After fix: redmine_highlightjs fix

anton-sergeev commented 7 years ago

This related to #18, #21, #26 Issues

miloja commented 6 years ago

This is not a proper fix. You should check file extension and language given

anton-sergeev commented 6 years ago

This is a common problem for html-like tags inside any language preformatted text. For example if I post the next:

<pre><code class="ruby">
some_string = "start <b>ddd</b>"
</code></pre>

I got the next result: redmine_highlightjs bug And with escaping suggested in this pull request: redmine_highlightjs with_fix

miloja commented 6 years ago

You're right. The fix is very ok. I haven't thought about HTML hidden in ruby string constant. :)