Defect #22046

Markdown XML code blocks not properly supported

Added by T H almost 7 years ago. Updated almost 3 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Text formatting
Target version:-
Resolution:Invalid Affected version:3.1.3

Description

Markdown code blocks are blocks of text surrounded by three backticks (```).

For example:

```xml
<example>test</example>
```

This should result in the following HTML:

<pre><code class="xml">
<example>test</example>
</code>< /pre>

(I can't seem to get the closing pre-tag to show up properly, either!)

However, what is actually output is:

<pre>
<example>test</example>
</pre>

The result is that syntax highlighting does not work. If it is too much trouble to include the language (the class attribute based on the language after the three backticks), it would be sufficient for me if the code was surrounded by

<code>…</code>
in addition to the pre-tags already in place.

History

#1 Updated by T H almost 7 years ago

This seems to work in general but not for XML. When I tried my example in Ruby, it did work. It seems to be related to the XML that I would like to display as “code”. Somehow, the XML-tags are passed to the browser and are being interpreted, i.e. swallowed, instead of being rendered.

#2 Updated by Toshi MARUYAMA almost 7 years ago

  • Subject changed from Markdown code blocks not properly supported to Markdown XML code blocks not properly supported

#3 Updated by T H almost 5 years ago

Bug still exists in 3.4.4

#4 Updated by Go MAEDA about 4 years ago

  • Status changed from New to Needs feedback

I could not reproduce the issue on Redmine 3.4.6. Do you still experience the issue in the latest version?

#5 Updated by T H almost 4 years ago

The issue is with the redmine_highlightjs plugin. I disabled the plugin and got a correct rendering of the xml content after clearing all old cache data. I guess this can be closed then. Sorry for the troubles.

#6 Updated by Marius BALTEANU almost 4 years ago

  • Status changed from Needs feedback to Closed
  • Resolution set to Invalid

T H wrote:

The issue is with the redmine_highlightjs plugin. I disabled the plugin and got a correct rendering of the xml content after clearing all old cache data. I guess this can be closed then. Sorry for the troubles.

Thanks for the feedback.

#7 Updated by Go MAEDA almost 4 years ago

If you like redmine_highlightjs plugin, I recommend you to try improved syntax highlighting feature of Redmine 4.0. It supports more than 100 languages.

#8 Updated by T H almost 3 years ago

We upgraded to 4.1 recently and I can confirm that the new syntax highlighting is really good. We don't miss the old plugin at all :-)

Also available in: Atom PDF