Fix id parsing for wiki toolbar now that we use actual html

This commit is contained in:
Oliver Günther
2026-03-19 14:39:20 +01:00
parent 4d731dcab6
commit 637a45beb4
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -83,7 +83,7 @@ module OpenProject
if options[:with_text_formatting] if options[:with_text_formatting]
# use either the provided id or fetch the one created by rails # use either the provided id or fetch the one created by rails
id = options[:id] || output.match(/<[^>]* id="(\w+)"[^>]*>/)[1] id = options[:id] || output.match(/<textarea[^>]* id="(\w+)"[^>]*>/)[1]
output << text_formatting_wrapper(id, options) output << text_formatting_wrapper(id, options)
end end
+1 -1
View File
@@ -63,7 +63,7 @@ class TabularFormBuilder < ActionView::Helpers::FormBuilder
->(input, options) { ->(input, options) {
if options[:with_text_formatting] if options[:with_text_formatting]
# use either the provided id or fetch the one created by rails # use either the provided id or fetch the one created by rails
id = options[:id] || input.match(/<[^>]* id="(\w+)"[^>]*>/)[1] id = options[:id] || input.match(/<textarea[^>]* id="(\w+)"[^>]*>/)[1]
options[:preview_context] ||= preview_context(object) options[:preview_context] ||= preview_context(object)
input.concat text_formatting_wrapper id, options input.concat text_formatting_wrapper id, options
end end