Project

General

Profile

Actions

Feature #22843

closed

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

Added by Jean-Claude Wippler almost 8 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Text formatting
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
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.


Files


Related issues

Blocked by Redmine - Defect #25299: Markdown pre-block could derive incorrect wiki sectionsClosedJean-Philippe Lang

Actions
Actions #1

Updated by Go MAEDA almost 8 years ago

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

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

Actions #2

Updated by Anonymous over 6 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.

Actions #3

Updated by Go MAEDA over 6 years ago

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

Updated by Go MAEDA over 6 years 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.

Actions #5

Updated by Anonymous over 6 years ago

@Maeda-san Thank you so much!

Actions #6

Updated by Go MAEDA about 6 years ago

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

Actions #7

Updated by Marius BÄ‚LTEANU about 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.

Actions #8

Updated by Go MAEDA about 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.

Actions

Also available in: Atom PDF