Patch #28119

Enable lax_spacing for markdown formatting in order to allow markdown blocks not surrounded by empty lines

Added by Marius BALTEANU 5 months ago. Updated 3 months ago.

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

0%

Category:Text formatting
Target version:3.3.7

Description

In the markdown standard format, an empty line is required before and after a block in order to render the content properly.

1. List without an empty line (doesn't work)
->
2. List with an empty line (works ok)
->
3. Enabling option :lax_spacing for markdown formatting (more details about this option on github) allows also the first format:
->

We already rolled out this change on our instance because most of the times, we forget to let the empty line and we observe that it doesn't work after we save the changes.

The patch is attached.

md_output_2.png (25.4 KB) Marius BALTEANU, 2018-02-01 07:36

md_output_1.png (24 KB) Marius BALTEANU, 2018-02-01 07:36

md_syntax_2.png (20.9 KB) Marius BALTEANU, 2018-02-01 07:36

md_syntax_1.png (21.7 KB) Marius BALTEANU, 2018-02-01 07:36

md_syntax_3.png (21.3 KB) Marius BALTEANU, 2018-02-01 07:39

md_output_3.png (20.9 KB) Marius BALTEANU, 2018-02-01 07:39

enable_lax_spacing_for_markdown.patch Magnifier (1.22 KB) Marius BALTEANU, 2018-02-01 10:18


Related issues

Duplicated by Redmine - Defect #25339: Markdown: list renders only with leading newline Closed

Associated revisions

Revision 17198
Added by Go MAEDA 4 months ago

Enable lax_spacing for markdown formatting (#28119).

Patch by Marius BALTEANU.

Revision 17247
Added by Go MAEDA 3 months ago

Merged r17198 to 3.4-stable (#28119).

Revision 17248
Added by Go MAEDA 3 months ago

Merged r17198 to 3.3-stable (#28119).

History

#1 Updated by Bernhard Rohloff 5 months ago

It happened to me just seconds ago.
+1

#2 Updated by Mischa The Evil 5 months ago

  • Target version set to Unplanned

This LGTM.

OT: Your patch reminded me btw that we might also want a simple test (like ApplicationHelperTest#test_footnotes) for markdown footnotes (in source:trunk/test/unit/lib/redmine/wiki_formatting/markdown_formatter_test.rb) as enabled per #16072. And while writing this, the questions of 'how many other textile syntax tests are there remaining lurking outside of source:/trunk/test/unit/lib/redmine/wiki_formatting/textile_formatter_test.rb and what do we want to do with them?' comes up... But that is certainly for another issue.

#3 Updated by Go MAEDA 4 months ago

  • Target version changed from Unplanned to 4.1.0

+1. It often annoys me.
I think we can commit this change to the trunk. Setting target version to 4.1.0.

#4 Updated by Go MAEDA 4 months ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Target version changed from 4.1.0 to 4.0.0

Committed. Thank you for the improvement.

#5 Updated by Go MAEDA 3 months ago

  • Duplicated by Defect #25339: Markdown: list renders only with leading newline added

#6 Updated by Go MAEDA 3 months ago

  • Target version changed from 4.0.0 to 3.3.7

Merged to stable branches.

Also available in: Atom PDF