Changeset 1288:c58d92b16aa4
- Timestamp:
- 01/11/10 00:33:50 (2 years ago)
- Branch:
- default
- File:
-
- 1 edited
-
zine/_ext/pottymouth.py (modified) (8 diffs, 1 prop)
Legend:
- Unmodified
- Added
- Removed
-
zine/_ext/pottymouth.py
- Property exe set to *
r695 r1288 62 62 # The following are simple, context-independent replacement tokens 63 63 TokenMatcher('EMDASH' , r'(--)' , replace=unichr(8212)), 64 # No way to reliably distinguish Endash from Hyphen, Dash & Minus, 64 # No way to reliably distinguish Endash from Hyphen, Dash & Minus, 65 65 # so we don't. See: http://www.alistapart.com/articles/emen/ 66 66 … … 89 89 Replacer(r"('')", unichr(8221)), 90 90 91 # First we look for inter-word " and ' 91 # First we look for inter-word " and ' 92 92 Replacer(r'(\b"\b)', unichr(34)), # double prime 93 93 Replacer(r"(\b'\b)", unichr(8217)), # apostrophe 94 # Then we look for opening or closing " and ' 95 Replacer(r'(\b"\B)', unichr(8221)), # close double quote 94 # Then we look for opening or closing " and ' 95 Replacer(r'(\b"\B)', unichr(8221)), # close double quote 96 96 Replacer(r'(\B"\b)', unichr(8220)), # open double quote 97 97 Replacer(r"(\b'\B)", unichr(8217)), # close single quote 98 98 Replacer(r"(\B'\b)", unichr(8216)), # open single quote 99 99 100 # Then we look for space-padded opening or closing " and ' 100 # Then we look for space-padded opening or closing " and ' 101 101 Replacer(r'(")(\s)', unichr(8221)+r'\2'), # close double quote 102 Replacer(r'(\s)(")', r'\1'+unichr(8220)), # open double quote 102 Replacer(r'(\s)(")', r'\1'+unichr(8220)), # open double quote 103 103 Replacer(r"(')(\s)", unichr(8217)+r'\2'), # close single quote 104 104 Replacer(r"(\s)(')", r'\1'+unichr(8216)), # open single quote … … 292 292 unordered_list=True, # disables all unordered lists (<ul>) 293 293 ordered_list=True, # disables all ordered lists (<ol>) 294 numbered_list=True, # disables '\d+\.' lists 294 numbered_list=True, # disables '\d+\.' lists 295 295 blockquote=True, # disables '>' <blockquote>s 296 296 bold=True, # disables *bold* … … 318 318 elif n == 'EMAIL' and not email: continue 319 319 elif n in ('HASH','DASH','NUMBERDOT','ITEMSTAR','BULLET') and not all_lists: 320 continue 320 continue 321 321 elif n in ('DASH','ITEMSTAR','BULLET') and not unordered_list: 322 322 continue … … 351 351 p += len(content) 352 352 353 if tm.replace is not None: 353 if tm.replace is not None: 354 354 unmatched_collection += tm.replace 355 355 break … … 531 531 else: 532 532 finished.append(top) 533 533 534 534 return finished 535 535 … … 598 598 stack = [] 599 599 finished = [] 600 600 601 601 last_bold_idx = -1 602 602 last_ital_idx = -1 … … 733 733 nb = self._parse_block(b) 734 734 parsed_blocks.append(nb) 735 735 736 736 return parsed_blocks 737 737
Note: See TracChangeset
for help on using the changeset viewer.