MCPcopy Create free account
hub / github.com/commitizen-tools/commitizen / Markdown

Class Markdown

commitizen/changelog_formats/markdown.py:12–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10
11
12class Markdown(BaseFormat):
13 extension = "md"
14
15 alternative_extensions = {"markdown", "mkd"}
16
17 RE_TITLE = re.compile(r"^(?P<level>#+) (?P<title>.*)$")
18
19 def parse_version_from_title(self, line: str) -> VersionTag | None:
20 m = self.RE_TITLE.match(line)
21 if not m:
22 return None
23 return self.tag_rules.search_version(m.group("title"))
24
25 def parse_title_level(self, line: str) -> int | None:
26 m = self.RE_TITLE.match(line)
27 if not m:
28 return None
29 return len(m.group("level"))

Callers 2

formatFunction · 0.90
format_with_tagsFunction · 0.90

Calls

no outgoing calls

Tested by 2

formatFunction · 0.72
format_with_tagsFunction · 0.72