Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bug breaking strings elements in metadata lists #377

Merged
merged 1 commit into from Nov 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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