Defect #42332
closed
"Edit this section" button is missing for headings rendered as multiline HTML
Added by Abe Tomoaki 4 months ago.
Updated 16 days ago.
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
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]
HTML contained line break.
<h3>
<code>title</code> a</h3>
- Category set to Text formatting
- Status changed from New to Confirmed
- Target version set to Candidate for next minor release
I wrote a test for this fix.
Setting the target version to 6.0.6.
- 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.
- Status changed from Resolved to Closed
Merged the fix into 6.0-stable branch in r23804.
Also available in: Atom
PDF