(self, parent, blocks)
| 225 | return bool(self.RE.search(block)) |
| 226 | |
| 227 | def run(self, parent, blocks): |
| 228 | block = blocks.pop(0) |
| 229 | m = self.RE.search(block) |
| 230 | if m: |
| 231 | before = block[:m.start()] # Lines before blockquote |
| 232 | # Pass lines before blockquote in recursively for parsing forst. |
| 233 | self.parser.parseBlocks(parent, [before]) |
| 234 | # Remove ``> `` from begining of each line. |
| 235 | block = '\n'.join([self.clean(line) for line in |
| 236 | block[m.start():].split('\n')]) |
| 237 | sibling = self.lastChild(parent) |
| 238 | if sibling and sibling.tag == "blockquote": |
| 239 | # Previous block was a blockquote so set that as this blocks parent |
| 240 | quote = sibling |
| 241 | else: |
| 242 | # This is a new blockquote. Create a new parent element. |
| 243 | quote = markdown.etree.SubElement(parent, 'blockquote') |
| 244 | # Recursively parse block with blockquote as parent. |
| 245 | self.parser.parseChunk(quote, block) |
| 246 | |
| 247 | def clean(self, line): |
| 248 | """ Remove ``>`` from beginning of a line. """ |
nothing calls this directly
no test coverage detected