プロジェクト

全般

プロフィール

Vote #66244

未完了

Escape <code> tag

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
Text formatting_26
開始日:
2009/12/22
期日:
進捗率:

0%

予定工数:
category_id:
26
version_id:
33
issue_org_id:
4472
author_id:
668
assigned_to_id:
0
comments:
4
status_id:
1
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[New]

説明

When using Textile-like wiki syntax, @pre@ tag with @code@ renders incorrectly. The simplest way to reproduce it is below:

42

It yields the same output as from:

42

What's more interesting, using @@@ syntax with @code@ inside makes renderer go absolutely crazy:

@42@

It outputs mysterious line:

@@


journals

--------------------------------------------------------------------------------
before pre section<pre>
111111111111
<code>code</code> code *bold* bold _italic_ italic +underline+ underline -deleted- deleted
222222222222
</pre>after pre section
--------------------------------------------------------------------------------
This issue remains a problem. I'm using Redmine 2.4.3.stable.

I try to display an XML response in a ticket. I use display my xml message nicely, I use the @code class="xml"@ tag for syntax highlighting and the @pre@ tag to keep the indenting. To do so nicely, I need to put the @code@ tag within the @pre@ tag. If I put the @pre@ tag within the @code@ tag, the code is not highlighted. This works well.

However there is no way to escape the @code@ tag if you want to. Maybe since @code@ is not a Textile tag, there is no way to escape it (using e.g. @notextile@). With or without the code highlighting, If my message itself contains a @code@ tag, I do not manage to display it correctly.

Example:

<pre><code class="xml"><?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<test>
<code>3</code>
<test>
</soapenv:Body>
</soapenv:Envelope></code></pre>

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 "formatter.rb":http://www.redmine.org/projects/redmine/repository/entry/trunk/lib/redmine/wiki_formatting/textile/formatter.rb .

--------------------------------------------------------------------------------
The only way to display a @code@ tag is with HTML escaping (using &amp;lt;), but only in clear text:

&lt;code>1234&lt;/code>

Within a @code@ or a @pre@, it does not work:

<code class="xml">&lt;code>1234&lt;/code></code>

<pre>&lt;code>1234&lt;/code></pre>

All means with @notextile@ don't work.

This is a simple code tag with @notextile@ before

<notextile></notextile><code>1234</code>

This is a simple code tag with @notextile@ around

<notextile><code>1234</code></notextile>

It doesn't work within a quote:

<notextile></notextile><code>1234</code>

It doesn't work within a @pre@ (with and without @notextile@):

<pre>
<code>1234</code>
</pre>

<pre>
<notextile></notextile><code>1234</code>
</pre>

It doesn't work within a @pre + code@ (with and without @notextile@):

<pre><code class="xml"><code>1234</code>
</code></pre>

<pre><code class="xml"><notextile></notextile><code>1234</code></code></pre>

It doesn't work within @==@ either:

== <code>1234</code> ==
<pre>== <code>1234</code> ==</pre>

--------------------------------------------------------------------------------


related_issues

duplicates,Closed,7375,<pre> ... </pre> doesn't escape wiki syntax correctly

Admin Redmine さんが3年以上前に更新

  • カテゴリText formatting_26 にセット
  • 対象バージョンCandidate for next minor release_33 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0