From 3c88fa1436ff159f785a1004c19f861dd6a39e67 Mon Sep 17 00:00:00 2001 From: Richard Berger <richard.berger@temple.edu> Date: Tue, 13 Sep 2016 20:13:53 -0400 Subject: [PATCH] Fix bug introduced in latest changes --- doc/utils/converters/lammpsdoc/txt2rst.py | 2 +- doc/utils/converters/tests/test_txt2rst.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/utils/converters/lammpsdoc/txt2rst.py b/doc/utils/converters/lammpsdoc/txt2rst.py index 3914e5782e..0997af80cd 100755 --- a/doc/utils/converters/lammpsdoc/txt2rst.py +++ b/doc/utils/converters/lammpsdoc/txt2rst.py @@ -169,7 +169,7 @@ class RSTFormatting(Formatting): def header(self, content, level): header_content = content.strip() - header_content = re.sub(r'[0-9]+(\.[0-9]*)*\s+', '', header_content) + header_content = re.sub(r'[0-9]+\.([0-9]*\.?)*\s+', '', header_content) header_underline = RSTFormatting.RST_HEADER_TYPES[level-1] * len(header_content) return header_content + "\n" + header_underline + "\n" diff --git a/doc/utils/converters/tests/test_txt2rst.py b/doc/utils/converters/tests/test_txt2rst.py index d6a5cb5a65..904eeb4749 100644 --- a/doc/utils/converters/tests/test_txt2rst.py +++ b/doc/utils/converters/tests/test_txt2rst.py @@ -205,6 +205,11 @@ class TestFormatting(unittest.TestCase): self.assertEqual("Level\n" "#####\n\n", s) + def test_no_filter_date(self): + s = self.txt2rst.convert("9 Sept 2016 version :h1\n") + self.assertEqual("9 Sept 2016 version\n" + "###################\n\n", s) + def test_all_breaks(self): s = self.txt2rst.convert("one\n" "two\n" -- GitLab