Page MenuHomePhabricator

Wrap the source (parts) in <code>
Closed, DeclinedPublic

Description

Currently, the output is (without line numbers)

<div dir="ltr" style="text-align: left;">
<pre class="source-html4strict">
<span class="sc2"><span class="kw2">&lt;h1&gt;</span></span>Hello world!<span class="sc2"><span class="kw2">&lt;/h1&gt;</span></span>
</pre></div>

or with line numbers

<div dir="ltr" style="text-align: left;">
<div class="source-html4strict" style="font-family: monospace;">
<ol>
<li class="li1">
<div class="de1"><span class="sc2"><span class="kw2">&lt;h1&gt;</span></span>Hello world!<span class="sc2"><span class="kw2">&lt;/h1&gt;</span></span></div>
</li>
</ol>
</div>
</div>

but it should be semantically following:

<div dir="ltr" style="text-align: left;">
<pre class="source-html4strict"><code>
<span class="sc2"><span class="kw2">&lt;h1&gt;</span></span>Hello world!<span class="sc2"><span class="kw2">&lt;/h1&gt;</span></span>
</code></pre></div>

or with line numbers

<div dir="ltr" style="text-align: left;">
<div class="source-html4strict" style="font-family: monospace;">
<ol>
<li class="li1">
<div class="de1"><code><span class="sc2"><span class="kw2">&lt;h1&gt;</span></span>Hello world!<span class="sc2"><span class="kw2">&lt;/h1&gt;</span></span></code></div>
</li>
</ol>
</div>
</div>

(<code> wrapper added since everything in <source> is code).

It will perhaps need some stylesheet tweaks along.


Version: unspecified
Severity: enhancement

Details

Reference
bz17147

Related Objects

StatusSubtypeAssignedTask
ResolvedNone
DeclinedNone

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:26 PM
bzimport added a project: SyntaxHighlight.
bzimport set Reference to bz17147.
bzimport added a subscriber: Unknown Object (MLST).
  • Bug 23708 has been marked as a duplicate of this bug. ***

What our extension does, is that it enclose Geshi output either in a span or a div depending on GESHI_HEADER_NONE, so this is not an upstream bug.

The bug is asking to enclose the output of Geshi in a <code> element. What Geshi does is that it takes some code and output an HTML rendered version of it which has semantically nothing to do with the original code. It is just some HTML.

<code> is to be used to represent a fragment of code.

So wrapping the HTML rendered output in a code element will mean that the rendered HTML is actually the code we wanted to show. Which is obviously wrong.

Thus I am marking this as won't fix.