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

Switch to MyST-Parser from recommonmark for parse_markdown function #25

Merged
merged 1 commit into from
Apr 28, 2021
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
install_requires=[
'recommonmark',
'jsonpointer',
'myst-parser',
'Sphinx',
],
namespace_packages=['sphinxcontrib'],
Expand Down
8 changes: 2 additions & 6 deletions sphinxcontrib/opendataservices.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@

from docutils.utils import SystemMessagePropagation
from recommonmark.transform import AutoStructify
from recommonmark.parser import CommonMarkParser
from sphinx.directives.code import LiteralInclude
from sphinx import addnodes
from docutils import nodes
from docutils.utils import new_document
from docutils.parsers.rst import directives, Directive
from docutils.parsers.rst.directives.tables import CSVTable
from docutils.parsers.rst.directives.admonitions import Note
from docutils.parsers.rst.roles import set_classes
from docutils.transforms import Transform
from myst_parser.main import to_docutils


# Based on positive_int_list from docutils
Expand Down Expand Up @@ -224,10 +223,7 @@ def run(self):


def parse_markdown(text):
parser = CommonMarkParser()
new_doc = new_document(None) # , self.document.settings)
parser.parse(text, new_doc)
return new_doc.children[:]
return to_docutils(text).children[:]


class MarkdownDirective(Directive):
Expand Down