-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Description
Inlines containing line breaks are converted to RST markup which seems to have different semantics depending on the position of the line breaks.
I assume that we can simply replace all newlines within inlines in the RST writer, but i could not find any mention to this case (newlines within inline markup) in the RST specification.
I tested using the docutils parser (via rst2html
) and i found out that inlines containing:
\n
trigger a syntax errortext\n
get parsed as a paragraph without style\ntext
trigger a syntax errortext\ntext
get parsed as a styled inline
i'm not sure about the correct methodology to follow here. should we use the code of the docutils parser as reference for the standard?
in my opinion it is sensible to replace all line breaks contained in inlines with spaces before writing RST. this way we will get rid of the syntax errors and handle the three strings consistently. this can easily be added to our inline transformation function that is already walking the inlines structure