From: Vladimír Vondruš Date: Mon, 22 Jan 2018 12:10:55 +0000 (+0100) Subject: m.code: properly preserve backslashes in inline :code:. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=b0b3674c5713a97e8973e19705108ff93894186f;p=blog.git m.code: properly preserve backslashes in inline :code:. The test now passes again. --- diff --git a/pelican-plugins/m/code.py b/pelican-plugins/m/code.py index 45c1d82f..4bf996d3 100644 --- a/pelican-plugins/m/code.py +++ b/pelican-plugins/m/code.py @@ -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: