Feature #22843

Change the value of "pre" button in Markdown toolbar from "~~~" to "```"

Added by Jean-Claude Wippler almost 2 years ago. Updated 8 days ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Go MAEDA% Done:

0%

Category:Text formatting
Target version:4.0.0
Resolution:Fixed

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.

22843-use-triple-back-quotes-for-fenced-code-block.diff Magnifier (81 KB) Go MAEDA, 2018-01-08 06:11


Related issues

Blocked by Redmine - Defect #25299: Markdown pre-block could derive incorrect wiki sections Closed

Associated revisions

Revision 17295
Added by Go MAEDA 8 days ago

Change the value of "pre" button in Markdown toolbar from "~~~" to "```" (#22843).

Patch by Go MAEDA.

History

#1 Updated by Go MAEDA almost 2 years ago

'~~~' is also correct Markdown and works as expected on my environment.

http://spec.commonmark.org/0.25/#code-fence

#2 Updated by Taiki IKEGAME 4 months 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.

#3 Updated by Go MAEDA 3 months ago

  • Blocked by Defect #25299: Markdown pre-block could derive incorrect wiki sections added

#4 Updated by Go MAEDA 3 months ago

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.

#5 Updated by Taiki IKEGAME 3 months ago

@Maeda-san Thank you so much!

#6 Updated by Go MAEDA 9 days ago

I will commit this change within a few days. Feedback welcome.

#7 Updated by Marius BALTEANU 9 days ago

Go MAEDA wrote:

I will commit this change within a few days. Feedback welcome.

I'm in favour of making this change.

#8 Updated by Go MAEDA 8 days 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.

Also available in: Atom PDF