comparison piecrust/page.py @ 728:e7481bbbb29f

Merge changes.
author Ludovic Chabant <ludovic@chabant.com>
date Mon, 30 May 2016 20:45:27 -0700
parents ab5c6a8ae90a 71309814e88f
children 58ebf50235a5
comparison
equal deleted inserted replaced
726:6e92b5cd0163 728:e7481bbbb29f
308 308
309 def _string_needs_parsing(txt, offset): 309 def _string_needs_parsing(txt, offset):
310 txtlen = len(txt) 310 txtlen = len(txt)
311 index = txt.find('-', offset) 311 index = txt.find('-', offset)
312 while index >= 0 and index < txtlen - 8: 312 while index >= 0 and index < txtlen - 8:
313 # Look for a potential `<--format-->`
314 if index > 0 and txt[index - 1] == '<' and txt[index + 1] == '-':
315 return True
316 # Look for a potential `---segment---`
313 if txt[index + 1] == '-' and txt[index + 2] == '-': 317 if txt[index + 1] == '-' and txt[index + 2] == '-':
314 return True 318 return True
315 index = txt.find('-', index + 1) 319 index = txt.find('-', index + 1)
316 return False 320 return False
317 321