Find and remove all Abbreviation references from the text. Each reference is set as a new AbbrPattern in the markdown instance.
(self, lines)
| 41 | """ Abbreviation Preprocessor - parse text for abbr references. """ |
| 42 | |
| 43 | def run(self, lines): |
| 44 | ''' |
| 45 | Find and remove all Abbreviation references from the text. |
| 46 | Each reference is set as a new AbbrPattern in the markdown instance. |
| 47 | |
| 48 | ''' |
| 49 | new_text = [] |
| 50 | for line in lines: |
| 51 | m = ABBR_REF_RE.match(line) |
| 52 | if m: |
| 53 | abbr = m.group('abbr').strip() |
| 54 | title = m.group('title').strip() |
| 55 | self.markdown.inlinePatterns['abbr-%s'%abbr] = \ |
| 56 | AbbrPattern(self._generate_pattern(abbr), title) |
| 57 | else: |
| 58 | new_text.append(line) |
| 59 | return new_text |
| 60 | |
| 61 | def _generate_pattern(self, text): |
| 62 | ''' |
nothing calls this directly
no test coverage detected