-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
RTE should insert a newline before code block #5674
Comments
If I'm understanding http://spec.commonmark.org/0.28/#fenced-code-blocks correctly, fenced code blocks can interrupt paragraphs:
Indented code blocks explictly cannot interrupt a paragraph. However, also from the commonmark spec:
So your example does highlight a bug in Riot's handling of the markdown - it should close the code block with the end of the document and render as per your expected result 😄 |
Ah, so that's different from e.g. GFM where fenced code blocks can't interrupt a paragraph. The joys of Markdown ...```
|
Actually the reference implementation at http://spec.commonmark.org/dingus/ also fails so either the reference implementation is wrong, the spec is wrong, or the interpretation of the spec is wrong. |
A newline should also be inserted when pressing the quote button (if not pressed at the beginning of a line) |
This seems to work properly in the new composer (you have to select the text that you want to be in the code block now to see the RTE rather than being a button to open a code block like it was previously) |
Description
Markdown requires that the code block triple-backticks start on a new line. However, the code button in the RTE does not add a newline, which may lead to "broken" markdown.
Steps to reproduce
I expect "bar" to be inside a code block. Instead I get an empty code block at the end (Markdown probably gets confused and thinks the last backticks actually start a codeblock rather than end it).
Actual result:
![image](https://user-images.githubusercontent.com/62835/33163209-9c5e54f6-d02d-11e7-8cd1-507c4cb15bf9.png)
Expected result:
![image](https://user-images.githubusercontent.com/62835/33163218-af850138-d02d-11e7-9547-a5de7e92e144.png)
Version information
Riot web c28d9e5-react-c002d3ff9967-js-36ff0ad0193e on FF57
The text was updated successfully, but these errors were encountered: