Return unescaped text given text with an inline placeholder.
(self, text: str)
| 234 | return self.__class__.__name__ |
| 235 | |
| 236 | def unescape(self, text: str) -> str: |
| 237 | """ Return unescaped text given text with an inline placeholder. """ |
| 238 | try: |
| 239 | stash = self.md.treeprocessors['inline'].stashed_nodes |
| 240 | except KeyError: # pragma: no cover |
| 241 | return text |
| 242 | |
| 243 | def get_stash(m): |
| 244 | id = m.group(1) |
| 245 | if id in stash: |
| 246 | value = stash.get(id) |
| 247 | if isinstance(value, str): |
| 248 | return value |
| 249 | else: |
| 250 | # An `etree` Element - return text content only |
| 251 | return ''.join(value.itertext()) |
| 252 | return util.INLINE_PLACEHOLDER_RE.sub(get_stash, text) |
| 253 | |
| 254 | |
| 255 | class InlineProcessor(Pattern): |
no outgoing calls
no test coverage detected