diff --git a/bin/lesson_check.py b/bin/lesson_check.py index 2216fa7..8416fa8 100644 --- a/bin/lesson_check.py +++ b/bin/lesson_check.py @@ -57,7 +57,16 @@ P_INTERNAL_INCLUDE_LINK = re.compile(r'^{% include ([^ ]*) %}$') # Pattern to match image-only and link-only lines -P_LINK_IMAGE_LINE = re.compile("^[> ]*(!?)\[([^]]+)\][([]([^)]+)[])][ ]*$") +P_LINK_IMAGE_LINE = re.compile(r''' + [> #]* # any number of '>', '#', and spaces + !? # ! or nothing + \[[^]]+\] # [any text] + [([] # ( or [ + [^])]+ # 1+ characters that are neither ] nor ) + [])] # ] or ) + (?:{:[^}]+})? # {:any text} or nothing + [ ]* # any number of spaces + \\?$ # \ or nothing + end of line''', re.VERBOSE) # What kinds of blockquotes are allowed? KNOWN_BLOCKQUOTES = {