From 5863f115dd496baff9947b31ac29d0fe12b636d8 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Fri, 12 Jan 2018 12:26:50 -0500 Subject: [PATCH] correctly escape 'a_ ' text, which is not a reference unlike 'a_b ' --- doc/utils/converters/lammpsdoc/txt2rst.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/utils/converters/lammpsdoc/txt2rst.py b/doc/utils/converters/lammpsdoc/txt2rst.py index e9a25e1893..17d0916157 100755 --- a/doc/utils/converters/lammpsdoc/txt2rst.py +++ b/doc/utils/converters/lammpsdoc/txt2rst.py @@ -67,7 +67,8 @@ class RSTMarkup(Markup): text = text.replace('*', '\\*') text = text.replace('^', '\\^') text = text.replace('|', '\\|') - text = re.sub(r'([^"])_', r'\1\\_', text) + text = re.sub(r'([^"])_([ \t\n\r\f])', r'\1\\\\_\2', text) + text = re.sub(r'([^"])_([^ \t\n\r\f])', r'\1\\_\2', text) return text def unescape_rst_chars(self, text):