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

Method add

markdown/inlinepatterns.py:657–670  ·  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

655 self.add(token, tags, smart, double)
656
657 def add(
658 self,
659 token: str,
660 tags: str,
661 smart: bool = False,
662 double: bool = False
663 ) -> None:
664 """Add a delimiter."""
665
666 if token not in self.tokens:
667 self.tokens.append(token)
668 self.delimiters[token] = Delimiter(token, tags, smart, double)
669 self.pattern = '|'.join([re.escape(t) for t in self.tokens])
670 self.compiled_re = re.compile(self.pattern, re.DOTALL | re.UNICODE)
671
672 def remove(self, token: str) -> None:
673 """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