Skip to content

Instantly share code, notes, and snippets.

@kozyszoo
Last active September 24, 2018 02:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kozyszoo/f6d7fcdb5303aef5168f85bac87561bc to your computer and use it in GitHub Desktop.
Save kozyszoo/f6d7fcdb5303aef5168f85bac87561bc to your computer and use it in GitHub Desktop.
py-gfm (GithubFlavoredMarkdownExtension) が import できない時の対処法[Python3] ref: https://qiita.com/kozzy/items/35c92fb6be4c8de916c4
$ pip3 install markdown
$ pip3 uninstall markdown
pip3 uninstall markdown
pip3 install git+https://github.com/Python-Markdown/markdown.git@regex-fixes
pip3 uninstall markdown
pip3 install git+https://github.com/Python-Markdown/markdown.git@2.6
import markdown
markdown.inlinepatterns.BRK
'\\[([^\\]\\[]*(\\[[^\\]\\[]*(\\[[^\\]\\[]*(\\[[^\\]\\[]*(\\[[^\\]\\[]*(\\[[^\\]\\[]*(\\[[^\\]\\[]*\\])*[^\\]\\[]*\\])*[^\\]\\[]*\\])*[^\\]\\[]*\\])*[^\\]\\[]*\\])*[^\\]\\[]*\\])*[^\\]\\[]*)\\]'
%load_ext tsumiki
%%tsumiki
:Markdown:
# Title
:HTML:::
<p>col0</p>
<font color="red">Red</font>
</br>
<font color="green">Green</font>
:Markdown:::
col1
* list1
* list2
:Markdown:::
col2
* list1
* list2
import markdown
from mdx_gfm import GithubFlavoredMarkdownExtension
source = """
Hello, *world*! This is a ~~good~~marvelous day!
Here is an auto link: https://example.org/
Le me introduce you to [task lists] (https://github.com/blog/1375-task-lists-in-gfm-issues-pulls-comments):
- [ ] eggs
- [x] milk
You can also have fenced code blocks:
```
import this
```
"""
# Direct conversion
html = markdown.markdown(source,
extensions=[GithubFlavoredMarkdownExtension()])
# Factory-like
md = markdown.Markdown(extensions=[GithubFlavoredMarkdownExtension()])
html = md.convert(source)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-2-58535ab67692> in <module>()
1 import markdown
2
----> 3 markdown.inlinepatterns.BRK
AttributeError: module 'markdown.inlinepatterns' has no attribute 'BRK'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment