Patch #32359

Markdown: Fix sections parsing with code blocks

Added by Jens Krämer 21 days ago. Updated 20 days ago.

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

0%

Category:Text formatting
Target version:4.1.0

Description

When there are spaces present between the code fence and the info string (as in ~~~ ruby vs ~~~ruby), the sections parsing fails to recognize the beginning of the code block and thus sections following such a block are not recognized correctly. Since it is perfectly valid Markdown to have one or more spaces in that place, the sections parsing should support that as well.

The patch extends an existing test case to demonstrate the behavior and fixes it by making the regular expression that is used more lenient.

0001-eases-the-regexp-used-to-determine-the-start-of-a-co.patch Magnifier (1.68 KB) Jens Krämer, 2019-10-29 03:25

test-wiki-page@2x.png (29.5 KB) Go MAEDA, 2019-10-29 04:22

without-patch@2x.png (18.7 KB) Go MAEDA, 2019-10-29 04:23

with-patch@2x.png (24.9 KB) Go MAEDA, 2019-10-29 04:25

Associated revisions

Revision 18880
Added by Go MAEDA 20 days ago

Eases the regexp used to determine the start of a code block (#32359).

Patch by Jens Krämer.

History

#1 Updated by Jens Krämer 21 days ago

#17686 may have been caused by the behavior which is fixed here.

#2 Updated by Go MAEDA 21 days ago

Confirmed the issue.

The patch can be applied cleanly to the trunk and 4.0-stable. Setting the target version to 4.0.6.

Test Wiki page:

Without the patch:

With the patch:

#3 Updated by Go MAEDA 20 days ago

  • Target version changed from 4.0.6 to 4.1.0

Go MAEDA wrote:

The patch can be applied cleanly to the trunk and 4.0-stable.

I misunderstood something. Unfortunately, the patch cannot be merged as it is due to r18810 (RuboCop related).

#4 Updated by Go MAEDA 20 days ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA

Committed the patch. Thank you for detecting and fixing this issue.

Also available in: Atom PDF