Skip to content

Commit b641685

Browse files
committed
Add build-time-check to catch Markdown-style links
1 parent 7efa795 commit b641685

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

scripts/create_build_adoc.py

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ def check_no_markdown(filename):
1515
asciidoc = re.sub('----\n.*?\n----', '', asciidoc, flags=re.DOTALL)
1616
if re.search('(?:^|\n)#+', asciidoc):
1717
raise Exception("{} contains a Markdown-style header (i.e. '#' rather than '=')".format(filename))
18+
if re.search(r'(\[.+?\]\(.+?\))', asciidoc):
19+
raise Exception("{} contains a Markdown-style link (i.e. '[title](url)' rather than 'url[title]')".format(filename))
1820

1921

2022
if __name__ == "__main__":

scripts/create_build_adoc_include.py

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ def check_no_markdown(filename):
1414
asciidoc = re.sub('----\n.*?\n----', '', asciidoc, flags=re.DOTALL)
1515
if re.search('(?:^|\n)#+', asciidoc):
1616
raise Exception("{} contains a Markdown-style header (i.e. '#' rather than '=')".format(filename))
17+
if re.search(r'(\[.+?\]\(.+?\))', asciidoc):
18+
raise Exception("{} contains a Markdown-style link (i.e. '[title](url)' rather than 'url[title]')".format(filename))
1719

1820

1921
if __name__ == "__main__":

0 commit comments

Comments
 (0)