Skip to content
Snippets Groups Projects
Commit 91488fcc authored by Raniere Silva's avatar Raniere Silva
Browse files

Merge pull request #66 from r-gaia-cs/improve-glossary-error-message

Improve message for glossary error
parents 3eaab252 8c0819be
Branches
Tags
No related merge requests found
......@@ -426,13 +426,14 @@ class ReferencePageValidator(MarkdownValidator):
```definition_lists``` extension.
That syntax isn't supported by the CommonMark parser, so we identify
terms manually."""
terms manually."""
glossary_keyword = glossary_entry[0]
if len(glossary_entry) < 2:
logging.error(
"In {0}:"
"Glossary entry must have at least two lines- "
"Glossary entry '{1}' must have at least two lines- "
"a term and a definition.".format(
self.filename))
glossary_keyword, self.filename))
return False
entry_is_valid = True
......@@ -441,17 +442,19 @@ class ReferencePageValidator(MarkdownValidator):
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, self.filename))
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, self.filename))
entry_is_valid = False
return entry_is_valid
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment