chiark / gitweb /
m.code: properly preserve backslashes in inline :code:.
authorVladimír Vondruš <mosra@centrum.cz>
Mon, 22 Jan 2018 12:10:55 +0000 (13:10 +0100)
committerVladimír Vondruš <mosra@centrum.cz>
Mon, 22 Jan 2018 13:17:29 +0000 (14:17 +0100)
The test now passes again.

pelican-plugins/m/code.py

index 45c1d82f769c476ed437a756600186b45428b38c..4bf996d3778475476b3e2138ee8432b4319d0508 100644 (file)
@@ -173,6 +173,10 @@ class Include(docutils.parsers.rst.directives.misc.Include):
         return codeblock.run()
 
 def code(role, rawtext, text, lineno, inliner, options={}, content=[]):
+    # In order to properly preserve backslashes
+    i = rawtext.find('`')
+    text = rawtext.split('`')[1]
+
     set_classes(options)
     classes = []
     if 'classes' in options: