Avoid inline styles inside <code> / <pre> conversion (#117)
* Avoid inline styles inside `<code>` / `<pre>` conversion The check used for this is analogous to that used to avoid escaping potential markup characters inside such tags. Fixes #103 --------- Co-authored-by: AlexVonB <AlexVonB@users.noreply.github.com>
This commit is contained in:
@@ -48,6 +48,8 @@ def abstract_inline_conversion(markup_fn):
|
||||
"""
|
||||
def implementation(self, el, text, convert_as_inline):
|
||||
markup = markup_fn(self)
|
||||
if el.find_parent(['pre', 'code', 'kbd', 'samp']):
|
||||
return text
|
||||
prefix, suffix, text = chomp(text)
|
||||
if not text:
|
||||
return ''
|
||||
|
||||
Reference in New Issue
Block a user