You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
a12399d introduced a regression: If the source text is in Markdown, it gets parsed as RST after translation.
In Sphinx 1.6.7 (and earlier), in publish_msgstr, reader.read() (i.e. SphinxBaseReader.read()) would select the parser based on the source_path suffix. After that commit, the parser is instead set by:
parser=app.registry.create_source_parser(app, '')
This means that it's always RST that parses the translated text. Obviously, if the translated text is in Markdown syntax, this will not result in a correct translation.
I'll submit a PR that determines the filetype based on the source_path. Ideally, this can be applied to 2.2.x.
To Reproduce
I have open PRs on CommonMark.py and recommonmark that also need to be merged to be able to translate Markdown in Sphinx, so it will be hard to create a 'small' example.
Expected behavior
I expect the translated text to be parsed as Markdown (not RST) if the source text is Markdown.
Describe the bug
a12399d introduced a regression: If the source text is in Markdown, it gets parsed as RST after translation.
In Sphinx 1.6.7 (and earlier), in
publish_msgstr
,reader.read()
(i.e.SphinxBaseReader.read()
) would select the parser based on thesource_path
suffix. After that commit, the parser is instead set by:This means that it's always RST that parses the translated text. Obviously, if the translated text is in Markdown syntax, this will not result in a correct translation.
I'll submit a PR that determines the filetype based on the
source_path
. Ideally, this can be applied to 2.2.x.To Reproduce
I have open PRs on CommonMark.py and recommonmark that also need to be merged to be able to translate Markdown in Sphinx, so it will be hard to create a 'small' example.
Expected behavior
I expect the translated text to be parsed as Markdown (not RST) if the source text is Markdown.
Your project
https://github.com/open-contracting-extensions/public-private-partnerships
Screenshots
N/A
Environment info
Additional context
This was originally fixed in aefab51 and then broken in a12399d
I have open PRs on CommonMark.py and recommonmark that also need to be merged to be able to translate Markdown in Sphinx:
The text was updated successfully, but these errors were encountered: