@@ -70,7 +70,7 @@ def build_inlinepatterns(md: Markdown, **kwargs: Any) -> util.Registry[InlinePro
7070
7171 """
7272 inlinePatterns = util .Registry ()
73- inlinePatterns .register (BacktickInlineProcessor (BACKTICK_RE , md ), 'backtick' , 190 )
73+ inlinePatterns .register (BacktickInlineProcessor (BACKTICK_RE ), 'backtick' , 190 )
7474 inlinePatterns .register (EscapeInlineProcessor (ESCAPE_RE , md ), 'escape' , 180 )
7575 inlinePatterns .register (ReferenceInlineProcessor (REFERENCE_RE , md ), 'reference' , 170 )
7676 inlinePatterns .register (LinkInlineProcessor (LINK_RE , md ), 'link' , 160 )
@@ -435,14 +435,12 @@ def handleMatch(self, m: re.Match[str], data: str) -> tuple[etree.Element, int,
435435
436436class BacktickInlineProcessor (InlineProcessor ):
437437 """ Return a `<code>` element containing the escaped matching text. """
438- def __init__ (self , pattern : str , md : Markdown ):
438+ def __init__ (self , pattern : str ):
439439 InlineProcessor .__init__ (self , pattern )
440440 self .ESCAPED_BSLASH = '{}{}{}' .format (util .STX , ord ('\\ ' ), util .ETX )
441441 self .tag = 'code'
442442 """ The tag of the rendered element. """
443443
444- self .md = md
445-
446444 def handleMatch (self , m : re .Match [str ], data : str ) -> tuple [etree .Element | str , int , int ]:
447445 """
448446 If the match contains `group(3)` of a pattern, then return a `code`
@@ -453,8 +451,6 @@ def handleMatch(self, m: re.Match[str], data: str) -> tuple[etree.Element | str,
453451
454452 """
455453 if m .group (3 ):
456- if data .lstrip ('[' ).rstrip (']' ).lower () in self .md .references : # ignore known references
457- return None , None , None
458454 el = etree .Element (self .tag )
459455 el .text = util .AtomicString (util .code_escape (m .group (3 ).strip ()))
460456 return el , m .start (0 ), m .end (0 )
@@ -883,8 +879,6 @@ class ReferenceInlineProcessor(LinkInlineProcessor):
883879
884880 RE_LINK = re .compile (r'\s?\[([^\]]*)\]' , re .DOTALL | re .UNICODE )
885881
886- RE_BACKTICK = re .compile (BACKTICK_RE , re .DOTALL | re .UNICODE )
887-
888882 def handleMatch (self , m : re .Match [str ], data : str ) -> tuple [etree .Element | None , int | None , int | None ]:
889883 """
890884 Return [`Element`][xml.etree.ElementTree.Element] returned by `makeTag` method or `(None, None, None)`.
@@ -931,19 +925,7 @@ def makeTag(self, href: str, title: str, text: str) -> etree.Element:
931925 if title :
932926 el .set ('title' , title )
933927
934- if '`' in text : # Process possible backtick within text
935- m = self .RE_BACKTICK .search (text )
936- if m and m .group (3 ):
937- el2 = etree .Element ('code' )
938- el2 .text = util .AtomicString (util .code_escape (m .group (3 ).strip ()))
939- el .append (el2 )
940- el .text = text [0 :m .start (0 )]
941- el2 .tail = text [m .end (0 ):]
942- else :
943- el .text = text
944- else :
945- el .text = text
946-
928+ el .text = text
947929 return el
948930
949931
0 commit comments