metacpan / metacpan-web

Web interface for MetaCPAN
http://metacpan.org
Other
417 stars 237 forks source link

Some verbatim text not showing in POD #1228

Closed book closed 4 years ago

book commented 10 years ago

The syntax highlighter that has a few issues with the verbatim text in the perlsecret manual page:

When viewing the source with my browser, the HTML code looks fine:

<h2 id="Bang-bang">Bang bang</h2>
<pre class="brush: pl; class-name: 'highlight'; toolbar: false; gutter: false; metacpan-verbatim">    !!</pre>

but when looking with the browser's inspector, the DOM looks like this:

<h2 id="Bang-bang">Bang bang</h2>
 <div>
  <div id="highlighter_440921" class="syntaxhighlighter nogutter highlight pl">
   <table border="0" cellpadding="0" cellspacing="0">
    <tbody>
     <tr>
      <td class="code">
       <div class="container">
        <div class="line number1 index0 alt2">&nbsp;</div>
       </div>
      </td>
     </tr>
    </tbody>
   </table>
  </div>
 </div>

which makes me think that a JavaScript syntax highlighter is used, and when it doesn't understand the given text, it just outputs &nbsp;. In my opinion, it should just return non-highlighted text.

Smylers commented 7 years ago

Another example: the code block of just 1; is invisible at: https://metacpan.org/pod/Moops#Outer-Sugar

HTML source:

<pre><code>   1;
   </code></pre>

Generated dom — slightly different from @book's above, because it still contains the <pre> element:

<pre>
  <div>
      <div id="highlighter_437710" class="syntaxhighlighter nogutter  perl">
      <table border="0" cellpadding="0" cellspacing="0">
        <tbody>
         <tr>
            <td class="code">
              <div class="container">
                <div class="line number1 index0 alt2">&nbsp;</div>
              </div>
            </td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
</pre>
Grinnz commented 7 years ago

Another example https://metacpan.org/pod/distribution/RL/bin/pl#SYNOPSIS

This is clearly caused by the javascript as the contents are visible with javascript disabled.

shlomif commented 6 years ago

I was told this is the same bug - https://github.com/syntaxhighlighter/syntaxhighlighter/issues/15 - it was closed.

matthewpersico commented 5 years ago

Mentioned again in https://www.reddit.com/r/perl/comments/bh9etr/no_matter_what_well_always_have_more_fun_than_the/

oalders commented 4 years ago

Closed via #2292. Thanks @gordon-fish for the fix and everyone else for the comments. This bug was squashed before its 6th birthday!