Skip to content

Commit 6d5b41e

Browse files
authored
Merge pull request carpentries/styles#582
bin/lesson_check.py: allow comments and empty lines in links.md Fixes carpentries/styles#581
2 parents 456c214 + 0c92757 commit 6d5b41e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

bin/lesson_check.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,17 @@ def read_references(reporter, ref_path):
227227
with open(ref_path, 'r', encoding='utf-8') as reader:
228228
for (num, line) in enumerate(reader, 1):
229229

230-
if P_INTERNAL_INCLUDE_LINK.search(line): continue
230+
# Skip empty lines
231+
if length(line.strip()) == 0:
232+
continue
233+
234+
# Skip HTML comments
235+
if line.strip().startswith("<!--") and line.strip().endswith("-->"):
236+
continue
237+
238+
# Skip Liquid's {% include ... %} lines
239+
if P_INTERNAL_INCLUDE_LINK.search(line):
240+
continue
231241

232242
m = P_INTERNAL_LINK_DEF.search(line)
233243

0 commit comments

Comments
 (0)