MCPcopy Create free account
hub / github.com/Python-Markdown/markdown / add

Method add

markdown/inlinepatterns.py:678–691  ·  view source on GitHub ↗

Add a delimiter.

(
        self,
        token: str,
        tags: str,
        smart: bool = False,
        double: bool = False
    )

Source from the content-addressed store, hash-verified

676 self.add(token, tags, smart, double)
677
678 def add(
679 self,
680 token: str,
681 tags: str,
682 smart: bool = False,
683 double: bool = False
684 ) -> None:
685 """Add a delimiter."""
686
687 if token not in self.tokens:
688 self.tokens.append(token)
689 self.delimiters[token] = Delimiter(token, tags, smart, double)
690 self.pattern = '|'.join([re.escape(t) for t in self.tokens])
691 self.compiled_re = re.compile(self.pattern, re.DOTALL | re.UNICODE)
692
693 def remove(self, token: str) -> None:
694 """Remove a token."""

Callers 6

__init__Method · 0.95
build_inlinepatternsFunction · 0.80
uniqueFunction · 0.80
runMethod · 0.80
unique_refMethod · 0.80
extendMarkdownMethod · 0.80

Calls 1

DelimiterClass · 0.85

Tested by

no test coverage detected