Project

General

Profile

Actions

Defect #44057

closed

Backport fix for #42332 (HEADING_RE missing /m flag) to 5.1-stable

Added by ilkwon jung 27 days ago. Updated 20 days ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Resolution:
Wont fix
Affected version:

Description

#42332 ("Edit this section" button is missing for headings rendered as multiline HTML) was fixed for 6.0.6 in r23802 / r23804 by adding the `/m` flag to `HEADING_RE` in `app/helpers/application_helper.rb`.

The same root cause also produces the following user-visible symptoms, which are not mentioned in the original ticket:

- Headings containing inline markup (italic, inline code, strong, links) are silently omitted from the `{{toc}}` macro output.
- The corresponding heading anchor IDs (`#heading-name`) are not generated, breaking intra-page links and cross-page deep links.

All three symptoms (missing edit pencil, missing TOC entry, missing anchor) share a single trigger: the CommonMark formatter emits multi-line HTML for headings that contain inline elements, e.g.


<h5>Heading with
<em>italic</em>
inside</h5>

and `(.+?)` in the pre-fix `HEADING_RE` does not cross `\n` in Ruby without the `/m` flag.

Request

Please consider backporting r23802 to 5.1-stable. The change is a single-character modification (`/i` → `/im`) with no behavioral side effects beyond the intended fix; the existing test added in 42332-test.patch covers it.

Reproduction

Same setup as #42332. To additionally confirm the TOC symptom, place `{{toc}}` on the same page and observe that headings containing `_italic_` or `` `code` `` are missing from the rendered table of contents in 5.1.x.

Environment

- Redmine version: 5.1.x
- Text formatting: common_mark (GFM)
- Related ticket: #42332 (Closed, Fixed in 6.0.6)

Actions #1

Updated by Go MAEDA 20 days ago

  • Status changed from New to Closed
  • Resolution set to Wont fix

Redmine 5.1 series is now quite old, and as described on https://www.redmine.org/projects/redmine/wiki/Download#Versions-status-and-releases-policy, only important security updates are currently provided for it. Therefore, we are unfortunately unable to accommodate your request to backport r23802 to 5.1-stable branch.

Please consider upgrading to the latest Redmine 6.1 series. Please also note that maintenance for Redmine 5.1 will end completely when Redmine 7.0 is released. Redmine 7.0 is expected to be released in the not-too-distant future.

Actions

Also available in: Atom PDF