From 45dbfcdc855b3c299acab1ee80bbf949c69ce395 Mon Sep 17 00:00:00 2001 From: Raniere Silva <raniere@ime.unicamp.br> Date: Fri, 1 May 2015 19:06:30 -0300 Subject: [PATCH] Fix check of glossary item CommonMark doesn't support definition list and we have to workaround this limitation. This commit removes the request that line continuation start with four white spaces because (1) CommonMark remove the white spaces and (2) Pandoc doesn't care about it. $ pandoc <<EOF foo : bar continue EOF <dl> <dt>foo</dt> <dd>bar continue </dd> </dl> $ pandoc <<EOF foo : bar continue EOF <dl> <dt>foo</dt> <dd>bar continue </dd> </dl> --- tools/check.py | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/tools/check.py b/tools/check.py index abf17ad..d15c521 100755 --- a/tools/check.py +++ b/tools/check.py @@ -565,24 +565,14 @@ class ReferencePageValidator(MarkdownValidator): entry_is_valid = True for line_index, line in enumerate(glossary_entry): - if line_index == 1: - if not re.match("^: ", line): - logging.error( - "In {0}: " - "At glossary entry '{1}' " - "First line of definition must " - "start with ': '.".format( - self.filename, glossary_keyword)) - entry_is_valid = False - elif line_index > 1: - if not re.match("^ ", line): - logging.error( - "In {0}: " - "At glossary entry '{1}' " - "Subsequent lines of definition must " - "start with ' '.".format( - self.filename, glossary_keyword, )) - entry_is_valid = False + if line_index == 1 and not re.match("^: ", line): + logging.error( + "In {0}: " + "At glossary entry '{1}' " + "First line of definition must " + "start with ': '.".format( + self.filename, glossary_keyword)) + entry_is_valid = False return entry_is_valid def _validate_glossary(self): -- GitLab