Commit graph

3 commits

Author SHA1 Message Date
Adelbert Chang
22434b5a69 Fix issue with syntax highlighting + line nums.
Below is the generated HTML for with line numbers and without line numbers, respectively.

```html
<!-- Without line numbers -->
<pre class="sourceCode scala">
    <code class="sourceCode scala">
        <span class="kw">trait</span>
        Monad[M[_]]
    </code>
</pre>

<!-- With line numbers -->
<table class="sourceCode scala numberLines">
    <tr class="sourceCode">
        <td class="lineNumbers">
            <pre>1</pre>
        </td>
        <td class="sourceCode">
            <pre>
                <code class="sourceCode scala">
                    <span class="kw">trait</span>
                    Monad[M[_]]
                </code>
            </pre>
        </td>
    </tr>
</table>

```

The markdown used is:

```

~~~~ { .scala }
trait Monad[M[_]]
~~~~

~~~~ { .scala .numberLines}
trait Monad[M[_]]
~~~~

```

Notice that without line numbers the outer `pre` has a `sourceCode` class whereas with line numbers the `sourceCode` class is only put in `code` and table-related tags.

In the original `syntax.css` file synax highlighting was only triggered if the `kw` and friends tags were within a `pre.sourceCode` - that means it did not trigger with line numbers. This change removes the requirement for the `pre` prefix so that highlighting is triggered with or without line numbers, so long as the code is within *some* `.sourceCode` tag.
2014-01-01 17:22:57 -08:00
Gun.io Whitespace Robot
c842ec66d7 Remove whitespace [Gun.io WhitespaceBot] 2011-12-15 22:35:46 -05:00
Jasper Van der Jeugt
edeef66180 Remove examples from this repo 2011-06-13 08:43:28 +02:00
Renamed from examples/brochure/css/syntax.css (Browse further)