Project

General

Profile

Actions

Defect #42332

closed

"Edit this section" button is missing for headings rendered as multiline HTML

Added by Abe Tomoaki 3 months ago. Updated 15 days ago.

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

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

I wrote the following markdown:

# Wiki

### title1

contents1

### `title` a

contents2

### title3

contents3

The display is as follows:

There is no pen symbol next to "`title` a".

The text that shows up on the edit screen when I click on the pen symbol next to "title3" is as follows:

### `title` a

contents2

ruby bin/about

$ RAILS_ENV=development ruby bin/about

Environment:
  Redmine version                6.0.3.devel
  Ruby version                   3.1.6-p260 (2024-05-29) [x86_64-linux]
  Rails version                  7.2.2.1
  Environment                    development
  Database adapter               SQLite
  Mailer queue                   ActiveJob::QueueAdapters::AsyncAdapter
  Mailer delivery                smtp
Redmine settings:
  Redmine theme                  Default
SCM:
  Subversion                     1.14.2
  Mercurial                      6.3.2
  Git                            2.39.5
  Filesystem                     
Redmine plugins:
  no plugin installed

Files

Screenshot.png (27.6 KB) Screenshot.png Abe Tomoaki, 2025-02-28 01:53
42332-test.patch (1.66 KB) 42332-test.patch Go MAEDA, 2025-05-26 01:57
Actions #1

Updated by Abe Tomoaki 3 months ago

The following changes fixed it.

diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 50519c890..e8a5a9f9c 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -1386,7 +1386,7 @@ module ApplicationHelper
               <|
               $)
     }x
-  HEADING_RE = /(<h(\d)( [^>]+)?>(.+?)<\/h(\d)>)/i unless const_defined?(:HEADING_RE)
+  HEADING_RE = /(<h(\d)( [^>]+)?>(.+?)<\/h(\d)>)/im unless const_defined?(:HEADING_RE)

   def parse_sections(text, project, obj, attr, only_path, options)
     return unless options[:edit_section_links]
Actions #2

Updated by Abe Tomoaki 3 months ago

HTML contained line break.

<h3>
<code>title</code> a</h3>

Actions #3

Updated by Go MAEDA 3 months ago

  • Category set to Text formatting
  • Status changed from New to Confirmed
  • Target version set to Candidate for next minor release
Actions #4

Updated by Go MAEDA 17 days ago

I wrote a test for this fix.

Setting the target version to 6.0.6.

Actions #5

Updated by Go MAEDA 16 days ago

  • Subject changed from "Edit this section" is shifted to "Edit this section" button is missing for headings rendered as multiline HTML
  • Status changed from Confirmed to Resolved
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the fix in r23802. Thank you for your contribution.

Actions #6

Updated by Go MAEDA 15 days ago

  • Status changed from Resolved to Closed

Merged the fix into 6.0-stable branch in r23804.

Actions #7

Updated by Abe Tomoaki 15 days ago

Thanks for the merging.

Actions

Also available in: Atom PDF