Mercurial > piecrust2
comparison 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 |
comparison
equal
deleted
inserted
replaced
1118:1dcebff866f1 | 1119:af57fbe9435a |
---|---|
299 | 299 |
300 return config, content, False | 300 return config, content, False |
301 | 301 |
302 | 302 |
303 segment_pattern = re.compile( | 303 segment_pattern = re.compile( |
304 r"""^\-\-\-\s*(?P<name>\w+)(\:(?P<fmt>\w+))?\s*\-\-\-\s*$""", | 304 r"^\-\-\-[ \t]*(?P<name>\w+)(\:(?P<fmt>\w+))?[ \t]*\-\-\-[ \t]*$", re.M) |
305 re.M) | |
306 | 305 |
307 | 306 |
308 def _count_lines(txt, start=0, end=-1): | 307 def _count_lines(txt, start=0, end=-1): |
309 cur = start | 308 cur = start |
310 line_count = 1 | 309 line_count = 1 |