Line numbers do not display when using nested ul/ol tags. For example:

<ol>
  <blockcode>
    // this displays correctly
  </blockcode>
  <li>
    <blockcode>
      // this displays correctly
    </blockcode>
  </li>
  <li>
    <ul>
      <blockcode>
        // this does not display correctly
      </blockcode>
      <li>
        <blockcode>
          // this does not display correctly
        </blockcode>
      </li>
    </ul>
  </li>
</ol>

Comments

soxofaan’s picture

I don't have time for the moment to look into his thoroughly,
but note that the line numbering in the GeSHi library is implemented with ordered lists (<ol>).

Also, the first and third blockcode in your code example are not proper HTML, as far as I know, so the result of that may depend on the used browser.
What do you get if you delete the first and third blockcode?

skaura’s picture

Thanks for the quick response.

First, I am embarrassed by my lack of HTML validating code. However, even after tidying up/validating the code I still have line number rendering issues. Here is the block of code I am testing with:

<ol>
  <li>
    <blockcode>
      // 1
    </blockcode>
  </li>
  <li>
    <ul>
      <li>
        <blockcode>
          // 2
        </blockcode>
      </li>
    </ul>
  </li>
</ol>

In the above code #2 doesn't render line numbers. I played around with some other code and it seems that any code (blockcode, etc) nested inside of a UL tag will not render line numbers.

Thanks again for your help (and a wonderful module).

haggins’s picture

I have a similar problem:
If any container is enabled i.e "

 container" then the linenumbers will not be displayed neither in FF3 nor in Opera 9.6

The odd thing is you can copy&paste the code WITH the (invisible) linenumbers in FF but not with Opera.
nicholas.alipaz’s picture

There is some css that is simply cutting off the line numbers. They are actually there. You just need to play with the (i think) padding of the li tags to get them to show. If I find time I will test it and tell you what to edit.

MarioTorresp’s picture

You need only modify the following line in the file geshifilter.css:

div.geshifilter > pre ol, div.geshifilter > div ol {
  padding-left:3.5em;
}

In this way will show all the numbers from the list.

soxofaan’s picture

Status: Active » Closed (duplicate)