chiark / gitweb /
m.code: test that backslashes in inline :code: are properly preserved.
authorVladimír Vondruš <mosra@centrum.cz>
Mon, 22 Jan 2018 12:10:04 +0000 (13:10 +0100)
committerVladimír Vondruš <mosra@centrum.cz>
Mon, 22 Jan 2018 13:17:29 +0000 (14:17 +0100)
They are not.

pelican-plugins/m/test/code/page.html
pelican-plugins/m/test/code/page.rst
pelican-plugins/m/test/math/page.html
pelican-plugins/m/test/math/page.rst

index 6e5050d4502bbcb41de7637209a5f5ebf6c6853b..16406a9d0f229c5a4e66c90eab086fdbaae60d69 100644 (file)
@@ -34,6 +34,7 @@
 CONTRIBUTING.rst  CREDITS.rst  <span class="g g-AnsiBrightBlue">doc</span>      <span class="g g-AnsiBrightBlue">pelican-plugins</span>  README.rst
 COPYING           <span class="g g-AnsiBrightBlue">css</span>          <span class="g g-AnsiBrightBlue">doxygen</span>  <span class="g g-AnsiBrightBlue">pelican-theme</span>    <span class="g g-AnsiBrightBlue">site</span></pre>
 <pre class="m-code">// this language is not highlighted</pre>
+<p>Properly preserve backslashes: <code class="m-code"><span class="k">\frac</span><span class="nb">{</span>a<span class="nb">}{</span>b<span class="nb">}</span></code></p>
 <!-- /content -->
       </div>
     </div>
index 2850b28c3ac6109d72704599aedfbf888a5e4dbb..7cccd0a8ef9a4abcb1b26af81839a677da651772 100644 (file)
@@ -3,6 +3,8 @@ m.code
 
 .. role:: cpp(code)
     :language: c++
+.. role:: tex(code)
+    :language: tex
 
 .. code:: c++
 
@@ -26,3 +28,5 @@ Inline code is here: :cpp:`constexpr`
 .. code:: whatthefuck
 
     // this language is not highlighted
+
+Properly preserve backslashes: :tex:`\frac{a}{b}`
index a1efbdf86a7044fa81385911ee3e2353e743072d..7a83b409496cf6647510c84f61431608a6cb461e 100644 (file)
@@ -167,7 +167,7 @@ Y = \sum_{i=0}^{n} B
 <use x='53.9533' xlink:href='#eq6-g2-66' y='0'/>
 </g>
 </svg></p>
-<p>The <code class="m-code"><span class="k">\cfrac</span></code> thing doesn't align well: <svg class="m-math" style="vertical-align: -6.3pt;" height='30.1719pt' version='1.1' viewBox='0 -14.1436 70.1821 24.1375' width='87.7276pt'>
+<p>The <code>\cfrac</code> thing doesn't align well: <svg class="m-math" style="vertical-align: -6.3pt;" height='30.1719pt' version='1.1' viewBox='0 -14.1436 70.1821 24.1375' width='87.7276pt'>
 <title>LaTeX Math</title>
 <desc>
 W = \sum_{i=0}^{n} \cfrac{w_i}{h_i}
@@ -198,8 +198,6 @@ W = \sum_{i=0}^{n} \cfrac{w_i}{h_i}
 <use x='65.9862' xlink:href='#eq7-g1-105' y='9.99393'/>
 </g>
 </svg></p>
-<p>Huh, apparently backslashes have to be escaped in things like this:
-<code class="m-code">frac</code></p>
 <!-- /content -->
       </div>
     </div>
index c920d1d0ecf4d1c77792d6382c2d4162d3aa3167..d5e8c3c27ad5e0cff7ac1f61c46f70fb0edafe18 100644 (file)
@@ -3,8 +3,6 @@ m.math
 
 :summary: no.
 
-.. role:: tex(code)
-    :language: tex
 .. role:: math-primary(math)
     :class: m-primary
 
@@ -21,7 +19,4 @@ and make sure there's enough space for all the complex :math:`W` things between
 the lines :math:`W = \sum_{i=0}^{n} \frac{w_i}{h_i}` because
 :math:`Y = \sum_{i=0}^{n} B`
 
-The :tex:`\\cfrac` thing doesn't align well: :math:`W = \sum_{i=0}^{n} \cfrac{w_i}{h_i}`
-
-Huh, apparently backslashes have to be escaped in things like this:
-:tex:`\frac`
+The ``\cfrac`` thing doesn't align well: :math:`W = \sum_{i=0}^{n} \cfrac{w_i}{h_i}`