https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292011-04-22T12:28:38ZRedmineRedmine - Defect #4472: Escape <code> taghttps://www.redmine.org/issues/4472?journal_id=282382011-04-22T12:28:38ZEtienne Massip
<ul><li><strong>Target version</strong> set to <i>Candidate for next minor release</i></li></ul> Redmine - Defect #4472: Escape <code> taghttps://www.redmine.org/issues/4472?journal_id=369722012-03-22T18:01:16ZIvan Cenov
<ul></ul><p>before pre section<pre>
111111111111
<code>code</code> code <strong>bold</strong> bold <em>italic</em> italic <ins>underline</ins> underline <del>deleted</del> deleted<br />222222222222<br /></pre>after pre section</p> Redmine - Defect #4472: Escape <code> taghttps://www.redmine.org/issues/4472?journal_id=674152015-11-20T08:22:34ZJonas De Meulenaere
<ul></ul><p>This issue remains a problem. I'm using Redmine 2.4.3.stable.</p>
<p>I try to display an XML response in a ticket. I use display my xml message nicely, I use the <code>code class="xml"</code> tag for syntax highlighting and the <code>pre</code> tag to keep the indenting. To do so nicely, I need to put the <code>code</code> tag within the <code>pre</code> tag. If I put the <code>pre</code> tag within the <code>code</code> tag, the code is not highlighted. This works well.</p>
<p>However there is no way to escape the <code>code</code> tag if you want to. Maybe since <code>code</code> is not a Textile tag, there is no way to escape it (using e.g. <code>notextile</code>). With or without the code highlighting, If my message itself contains a <code>code</code> tag, I do not manage to display it correctly.</p>
<p>Example:</p>
<pre><code class="xml syntaxhl"><span class="cp"><?xml version="1.0" encoding="UTF-8"?></span><span class="nt"><soapenv:Envelope</span> <span class="na">xmlns:soapenv=</span><span class="s">"http://schemas.xmlsoap.org/soap/envelope/"</span><span class="nt">></span>
<span class="nt"><soapenv:Body></span>
<span class="nt"><test></span>
<span class="ni">&lt;</span>code<span class="ni">&gt;</span>3<span class="ni">&lt;</span>/code<span class="ni">&gt;</span>
<span class="ni">&lt;</span>test<span class="ni">&gt;</span>
<span class="ni">&lt;</span>/soapenv:Body<span class="ni">&gt;</span>
<span class="ni">&lt;</span>/soapenv:Envelope<span class="ni">&gt;</span></code></pre>
<p>The problem lies IMHO in the fact that in different libraries/plugins are used (CodeRay & RedCloth/Textile) and Redmine does some patching on it, see in the bottom of <a href="http://www.redmine.org/projects/redmine/repository/entry/trunk/lib/redmine/wiki_formatting/textile/formatter.rb" class="external">formatter.rb</a> .</p> Redmine - Defect #4472: Escape <code> taghttps://www.redmine.org/issues/4472?journal_id=781202017-04-20T09:57:03ZJonas De Meulenaere
<ul><li><strong>Subject</strong> changed from <i><code> inside <pre></i> to <i>Escape <code> tag</i></li></ul><p>The only way to display a <code>code</code> tag is with HTML escaping (using &lt;), but only in clear text:</p>
<p><code>1234</code></p>
<p>Within a <code>code</code> or a <code>pre</code>, it does not work:</p>
<code class="xml syntaxhl"><span class="ni">&lt;</span>code>1234<span class="ni">&lt;</span>/code></code>
<pre>&lt;code>1234&lt;/code></pre>
<p>All means with <code>notextile</code> don't work.</p>
<p>This is a simple code tag with <code>notextile</code> before</p>
<code>1234</code>
<p>This is a simple code tag with <code>notextile</code> around</p>
<code>1234</code>
<p>It doesn't work within a quote:</p>
<code>1234</code>
<p>It doesn't work within a <code>pre</code> (with and without <code>notextile</code>):</p>
<pre>
<code>1234</code><br /></pre>
<pre>
<code>1234</code><br /></pre>
<p>It doesn't work within a <code>pre + code</code> (with and without <code>notextile</code>):</p>
<pre><code class="xml syntaxhl"><span class="ni">&lt;</span>code<span class="ni">&gt;</span>1234<span class="ni">&lt;</span>/code<span class="ni">&gt;</span>
</code></pre>
<pre><code class="xml syntaxhl"><code>1234</code></code></pre>
<p>It doesn't work within <code>==</code> either:</p>
<code>1234</code> <br /><pre>== <code>1234</code> ==</pre> Redmine - Defect #4472: Escape <code> taghttps://www.redmine.org/issues/4472?journal_id=1076322022-08-18T08:45:18ZBenjamin GUILLAUME
<ul></ul><p>Hello,</p>
<p>I just had the same issue. I need to use the <code><code></code> xml tag inside <code><pre><code class="xml"></code></pre></code> to correctly describe the issue to our dev team.</p>
<p>The only way to have something "relevant" is to use <code>&nbsp;</code>, <code>&lt;</code> and <code>&gt;</code> surrounded by <code>@</code> caracter :</p>
<p><code><Response><br /> <search><br /> <code>3</code><br /> <message>OK</message><br /> <count>0</count><br /> <nextPage>false</nextPage><br /> <nextPageUrl/><br /> </search><br /></Response></code></p>
<p>But still, it's not very convenient.</p>
<p>Here is the output when using <code><code></code> tag inside <code><pre><code class="xml"></code></pre></code>:</p>
<pre><code class="xml syntaxhl"><span class="nt"><Response></span>
<span class="nt"><search></span>
<span class="ni">&lt;</span>code<span class="ni">&gt;</span>3<span class="ni">&lt;</span>/code<span class="ni">&gt;</span>
<span class="ni">&lt;</span>message<span class="ni">&gt;</span>OK<span class="ni">&lt;</span>/message<span class="ni">&gt;</span>
<span class="ni">&lt;</span>count<span class="ni">&gt;</span>0<span class="ni">&lt;</span>/count<span class="ni">&gt;</span>
<span class="ni">&lt;</span>nextPage<span class="ni">&gt;</span>false<span class="ni">&lt;</span>/nextPage<span class="ni">&gt;</span>
<span class="ni">&lt;</span>nextPageUrl/<span class="ni">&gt;</span>
<span class="ni">&lt;</span>/search<span class="ni">&gt;</span>
<span class="ni">&lt;</span>/Response<span class="ni">&gt;</span>
</code></pre>
<p>Is there any other known workaround? Is it planed to correct this point?</p>
<p>Thanks!</p>