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

started with ------ #249

Open
hejuting opened this issue Mar 14, 2017 · 1 comment
Open

started with ------ #249

hejuting opened this issue Mar 14, 2017 · 1 comment

Comments

@hejuting
Copy link

It occur error when the markdown text start with '------' and there aren't warp before the '------' .
mymarkdown = markdown2.Markdown( extras=["code-friendly", "code-color", "cuddled-lists", "fenced-code-blocks", "footnotes", "header-ids", "markdown-in-html", "metadata", "nofollow", "numbering", "pyshell", "smarty-pants", "spoiler", "target-blank-links", "toc", "tables", "use-file-vars", "wiki-tables", "xml", "tag-friendly"] ) print mymarkdown.convert("------sdfsadfds")
eg error:
Traceback (most recent call last): File "C:/Users/Administrator/PycharmProjects/teamdoc/website/tests.py", line 9, in <module> print mymarkdown.convert("------sdfsadfds") File "C:\Python27\lib\site-packages\markdown2.py", line 319, in convert text = self._extract_metadata(text) File "C:\Python27\lib\site-packages\markdown2.py", line 414, in _extract_metadata metadata_content = fence_splits[1] IndexError: list index out of range
It works if i add '\n' before the '------'.
eg:
print mymarkdown.convert("\n------sdfsadfds")
It works if i don't open these extras.
eg:
mymarkdown=markdown2.Markdown()

@nicholasserra
Copy link
Collaborator

Thanks for the report! PRs welcome if you want to try to patch this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants