-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
nested inline styles turn into extra RST text #4368
Comments
here is an unit test italia@185309e |
i'm using |
See #4339 for an alternative approach? |
that approach uses substitutions to produce nested inline markup, which as far as i understand are not supported in RST by design. to me it looks like an hack which relies on the implementation of RST parsers. as far as i understand the logic needed to adopt the hack would feature:
i'm not sure that the complexity added to the code would be worth the value added by styled links at this stage. the pull request we propose is already bringing some clear advantages without trying to work around RST limitations, further improvements could be discussed separately |
An alternative approach to selecting the outermost format would be to always give priority to bold over italics. The rationale behind this is that bold formatting is used to highlight or give emphasis to something. Removing bold altogether could be a loss of useful information for the reader, probably more than losing an italics along the way. Proposed approach:
|
i like how @atorin's solution looks like even though at the moment i'm not sure how to write it, i'll try some approaches to it |
done, i rebased the branch with a version that does what described by i have some doubts about the handling described above for strong markup is now also given to |
i went through all of this again while investigating other issues related to inlines. the solution i proposed was a pure the logic proposed by @atorin produces visually appealing documents and we can keep using it through this filter. integrating it in the writer is complex though, so before working on it i would like to know whether we all agree about the direction. the implementation of until now inline processing logic did not require to navigate the nested structure so it could be cleanly contained in |
nested inlines are not valid RST syntax, so we flatten them following some readability criteria discussed in jgm#4368.
nested inlines are not valid RST syntax, so we flatten them following some readability criteria discussed in jgm#4368.
nested inlines are not valid RST syntax, so we flatten them following some readability criteria discussed in jgm#4368.
a block like
[Emph [Str "first", Strong [Str "second"]]]
gets translated by pandoc into*first\ **second***
which is not an accurate RST translation because RST does not support nested inlinesthis does not represent a syntax error but it causes extra text to be displayed to the user when RST is converted to other formats like HTML
we propose to ignore the innermost styles, in order to preserve the style given to a broader section of the text
The text was updated successfully, but these errors were encountered: