Mercurial > piecrust2
changeset 727:71309814e88f
bug: Also look for format changes when determining if a page needs parsing.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Mon, 30 May 2016 20:44:36 -0700 |
parents | dab26ab3d533 |
children | e7481bbbb29f |
files | piecrust/page.py |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/piecrust/page.py Sat Apr 16 23:12:06 2016 -0700 +++ b/piecrust/page.py Mon May 30 20:44:36 2016 -0700 @@ -307,6 +307,10 @@ txtlen = len(txt) index = txt.find('-', offset) while index >= 0 and index < txtlen - 8: + # Look for a potential `<--format-->` + if index > 0 and txt[index - 1] == '<' and txt[index + 1] == '-': + return True + # Look for a potential `---segment---` if txt[index + 1] == '-' and txt[index + 2] == '-': return True index = txt.find('-', index + 1)