Skip to content

Commit

Permalink
Merge pull request #377 from andrenasturas/master
Browse files Browse the repository at this point in the history
Fixed bug breaking strings elements in metadata lists
  • Loading branch information
nicholasserra committed Nov 27, 2020
2 parents 91d4854 + 01d1c9d commit 2f756d1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/markdown2.py
Expand Up @@ -452,7 +452,7 @@ def preprocess(self, text):
r"(.*:\s+>\n\s+[\S\s]+?)(?=\n\w+\s*:\s*\w+\n|\Z)", re.MULTILINE
)
_key_val_list_pat = re.compile(
r"^-(?:[ \t]*([^:\s]*)(?:[ \t]*[:-][ \t]*(\S+))?)(?:\n((?:[ \t]+[^\n]+\n?)+))?",
r"^-(?:[ \t]*([^\n]*)(?:[ \t]*[:-][ \t]*(\S+))?)(?:\n((?:[ \t]+[^\n]+\n?)+))?",
re.MULTILINE,
)
_key_val_dict_pat = re.compile(
Expand Down
2 changes: 1 addition & 1 deletion test/tm-cases/metadata.metadata
Expand Up @@ -7,5 +7,5 @@
"and some": "long value\n that goes multiline",
"another": "example",
"alist": ["a", "b", "c"],
"adict": {"key": "foo", "a nested list": ["one", "two", "Even multiline strings are allowed\n in nested structured data\n if linebreaks and indent are respected !", {"subkey": "and another dict in a list"}]}
"adict": {"key": "foo", "a nested list": ["one", "two", "Even multiline strings are allowed\n in nested structured data\n if linebreaks and indent are respected !", {"subkey": "and another dict in a list"}, "but one-liners remains: simple strings"]}
}
1 change: 1 addition & 0 deletions test/tm-cases/metadata.text
Expand Up @@ -23,6 +23,7 @@ adict:
if linebreaks and indent are respected !
-
subkey: and another dict in a list
- but one-liners remains: simple strings
---
# The real text

Expand Down

0 comments on commit 2f756d1

Please sign in to comment.