Feature #22843
closedChange the value of "pre" button in Markdown toolbar from "~~~" to "```"
0%
Description
When using the pre
button in the web editor to insert a pre-formatted code block for a project which uses Markdown formatting, the lines inserted contain "~~~
", which does not work in Markdown. It should insert lines "```
" instead (possibly also preceded and followed by an empty line, not sure).
Very easy to reproduce: in a Markdown project, add an entry, press the "pre" button, click on "Preview". The resulting page shows "~~~" instead of a proper code block.
Files
Related issues
Updated by Go MAEDA over 8 years ago
'~~~' is also correct Markdown and works as expected on my environment.
Updated by Anonymous almost 7 years ago
I made a long name plugin.
https://www.redmine.org/plugins/redmine_github_style_fenced_code_block
Certainly triple tildes are not wrong syntax, but most people are using triple back quotes.
So, it is one of the features of markdown that the readability is high even for raw data. However, the triple tildea is similar to the strike (double tilde) syntax, and it is less readable. If it is a triple backquote, it can be distinguished from a strike. In addition, since it is similar in syntax to inline code (single backquote), the format of the document is consistent.
I think that the input of the markdown toolbar should be changed to triple backquote.
Updated by Go MAEDA almost 7 years ago
- Blocked by Defect #25299: Markdown pre-block could derive incorrect wiki sections added
Updated by Go MAEDA almost 7 years ago
- File 22843-use-triple-back-quotes-for-fenced-code-block.diff 22843-use-triple-back-quotes-for-fenced-code-block.diff added
- Tracker changed from Defect to Feature
- Subject changed from Markdown code blocks not inserted properly to Use "```" instead of "~~~" for fenced code blocks in Markdown
- Target version set to 4.1.0
Taiki IKEGAME wrote:
Certainly triple tildes are not wrong syntax, but most people are using triple back quotes.
I agree with you, I feel "```" is much more popular than "~~~". To be honest, I have not seen "~~~" other than Redmine.
I wrote a patch to use "```" instead of "~~~". I suggest including this change in the future release. Setting target version to 4.1.0.
Updated by Go MAEDA over 6 years ago
I will commit this change within a few days. Feedback welcome.
Updated by Marius BÄ‚LTEANU over 6 years ago
Go MAEDA wrote:
I will commit this change within a few days. Feedback welcome.
I'm in favour of making this change.
Updated by Go MAEDA over 6 years ago
- Subject changed from Use "```" instead of "~~~" for fenced code blocks in Markdown to Change the value of "pre" button in Markdown toolbar from "~~~" to "```"
- Status changed from New to Closed
- Assignee set to Go MAEDA
- Target version changed from 4.1.0 to 4.0.0
- Resolution set to Fixed
Committed.