Page MenuHomePhabricator

Un-numbered code blocks in dls generate poorly nested html
Closed, DuplicatePublic

Description

As can be seen here, syntaxhighlight tags do not always cooperate well with definition lists

This works fine:

:Here's a dd that contains code with line numbers
:<syntaxhighlight lang="lua" line="GESHI_FANCY_LINE_NUMBERS">
print "Everything is ok"
print "Everything is still ok"
</syntaxhighlight>

But this:

: And here's one that doesn't have numbers
:<syntaxhighlight lang="lua">
print "Everything is ok"
print "Everything is no longer ok"
</syntaxhighlight>
:That did not work so well...

Renders as

<dl>
  <dd>And here's one that doesn't have numbers</dd>
  <dd>
    <div dir="ltr" class="mw-geshi mw-code mw-content-ltr">
      <div class="lua source-lua">
        <pre class="de1">
          <span class="kw3">print</span> <span class="st0">"Everything is ok"</span>
        </pre>
      </div>
    </div>
  </dd>
</dl>
<p><span class="kw3">print</span> <span class="st0">"Everything is no longer ok"</span></p>
<dl>
   <dd>That did not work so well...</dd>
</dl>

Notice how all but the first line has been pulled out of the containing pre!

Event Timeline

eric-wieser raised the priority of this task from to Needs Triage.
eric-wieser updated the task description. (Show Details)
eric-wieser added a project: SyntaxHighlight.
eric-wieser subscribed.