Skip to content

Commit

Permalink
bump markdown-it-py version
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsewell committed Mar 29, 2020
1 parent 034be2a commit c97d2d7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion myst_parser/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.8.0a1"
__version__ = "0.8.0a2"


def setup(app):
Expand Down
21 changes: 12 additions & 9 deletions myst_parser/docutils_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,15 +456,18 @@ def render_front_matter(self, token):
since `process_doc` just converts them back to text.
"""
try:
data = yaml.safe_load(token.content)
except (yaml.parser.ParserError, yaml.scanner.ScannerError) as error:
msg_node = self.reporter.error(
"Front matter block:\n" + str(error), line=token.map[0]
)
msg_node += nodes.literal_block(token.content, token.content)
self.current_node += [msg_node]
return
if not isinstance(token.content, dict):
try:
data = yaml.safe_load(token.content)
except (yaml.parser.ParserError, yaml.scanner.ScannerError) as error:
msg_node = self.reporter.error(
"Front matter block:\n" + str(error), line=token.map[0]
)
msg_node += nodes.literal_block(token.content, token.content)
self.current_node += [msg_node]
return
else:
data = token.content

docinfo = dict_to_docinfo(data)
self.current_node.append(docinfo)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
],
keywords="markdown lexer parser development docutils sphinx",
python_requires=">=3.6",
install_requires=["markdown-it-py~=0.4.1"],
install_requires=["markdown-it-py~=0.4.2"],
extras_require={
"sphinx": ["pyyaml", "docutils>=0.15", "sphinx>=2,<3"],
"code_style": ["flake8<3.8.0,>=3.7.0", "black", "pre-commit==1.17.0"],
Expand Down

0 comments on commit c97d2d7

Please sign in to comment.