git.iko.soy/typeable/pandoc
on master help sign in
Highlighting: Add language as class name.

This restores behavior of 1.8.2.1. Adjusted tests.

commit3122959064412a40d650840467f2838326687251 authorJohn MacFarlane <fiddlosopher@gmail.com> dateTue 27 Dec 2011, 22:23 (15 years ago) parent70b4ec9
3 files changed+3−3
src/Text/Pandoc/Highlighting.hs+1−1 tests/lhs-test.html+1−1 tests/lhs-test.html+lhs+1−1
src/Text/Pandoc/Highlighting.hs+1−1
@@ -64,6 +64,6 @@ highlight formatter (_, classes, keyvals) rawCode =
6464 in case find (`elem` lcLanguages) lcclasses of
6565 Nothing -> Nothing
6666 Just language -> Just
67− $ formatter fmtOpts
67+ $ formatter fmtOpts{ codeClasses = [language] }
6868 $ highlightAs language rawCode
6969
tests/lhs-test.html+1−1
@@ -27,7 +27,7 @@ code > span.er { color: #ff0000; font-weight: bold; }
2727<body>
2828<h1 id="lhs-test">lhs test</h1>
2929<p><code>unsplit</code> is an arrow that takes a pair of values and combines them to return a single value:</p>
30−<pre class="sourceCode"><code class="sourceCode"><span class="ot">unsplit ::</span> (<span class="dt">Arrow</span> a) <span class="ot">=&gt;</span> (b <span class="ot">-&gt;</span> c <span class="ot">-&gt;</span> d) <span class="ot">-&gt;</span> a (b, c) d
30+<pre class="sourceCode"><code class="sourceCode haskell"><span class="ot">unsplit ::</span> (<span class="dt">Arrow</span> a) <span class="ot">=&gt;</span> (b <span class="ot">-&gt;</span> c <span class="ot">-&gt;</span> d) <span class="ot">-&gt;</span> a (b, c) d
3131unsplit <span class="fu">=</span> arr <span class="fu">.</span> <span class="fu">uncurry</span>
3232 <span class="co">-- arr (\op (x,y) -&gt; x `op` y) </span></code></pre>
3333<p><code>(***)</code> combines two arrows into a new arrow by running the two arrows on a pair of values (one arrow on the first item of the pair and one arrow on the second item of the pair).</p>
tests/lhs-test.html+lhs+1−1
@@ -27,7 +27,7 @@ code > span.er { color: #ff0000; font-weight: bold; }
2727<body>
2828<h1 id="lhs-test">lhs test</h1>
2929<p><code>unsplit</code> is an arrow that takes a pair of values and combines them to return a single value:</p>
30−<pre class="sourceCode"><code class="sourceCode"><span class="fu">&gt;</span><span class="ot"> unsplit ::</span> (<span class="dt">Arrow</span> a) <span class="ot">=&gt;</span> (b <span class="ot">-&gt;</span> c <span class="ot">-&gt;</span> d) <span class="ot">-&gt;</span> a (b, c) d
30+<pre class="sourceCode"><code class="sourceCode haskell"><span class="fu">&gt;</span><span class="ot"> unsplit ::</span> (<span class="dt">Arrow</span> a) <span class="ot">=&gt;</span> (b <span class="ot">-&gt;</span> c <span class="ot">-&gt;</span> d) <span class="ot">-&gt;</span> a (b, c) d
3131<span class="fu">&gt;</span> unsplit <span class="fu">=</span> arr <span class="fu">.</span> <span class="fu">uncurry</span>
3232<span class="fu">&gt;</span> <span class="co">-- arr (\op (x,y) -&gt; x `op` y) </span></code></pre>
3333<p><code>(***)</code> combines two arrows into a new arrow by running the two arrows on a pair of values (one arrow on the first item of the pair and one arrow on the second item of the pair).</p>