Mercurial > piecrust2
diff piecrust/page.py @ 1119:af57fbe9435a
formatter: Fix the regex used to find page segments.
It was incorrectly matching a Markdown horizontal rule followed by a title if
the title had exactly 3 dashes underneath it.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Tue, 27 Feb 2018 15:43:50 -0800 |
parents | 2e269c02ab97 |
children | e307f61d7034 |
line wrap: on
line diff
--- a/piecrust/page.py Sun Feb 25 23:19:38 2018 -0800 +++ b/piecrust/page.py Tue Feb 27 15:43:50 2018 -0800 @@ -301,8 +301,7 @@ segment_pattern = re.compile( - r"""^\-\-\-\s*(?P<name>\w+)(\:(?P<fmt>\w+))?\s*\-\-\-\s*$""", - re.M) + r"^\-\-\-[ \t]*(?P<name>\w+)(\:(?P<fmt>\w+))?[ \t]*\-\-\-[ \t]*$", re.M) def _count_lines(txt, start=0, end=-1):