]> source.dussan.org Git - redmine.git/commitdiff
Add underline button to CommonMark Markdown toolbar (#40939).
authorGo MAEDA <maeda@farend.jp>
Wed, 9 Oct 2024 14:04:57 +0000 (14:04 +0000)
committerGo MAEDA <maeda@farend.jp>
Wed, 9 Oct 2024 14:04:57 +0000 (14:04 +0000)
Contributed by Yasu Saku (user:skys).

git-svn-id: https://svn.redmine.org/redmine/trunk@23106 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/assets/javascripts/jstoolbar/common_mark.js
lib/redmine/wiki_formatting/common_mark/sanitization_filter.rb

index f9e5ba7cd9470f8b50f6f61c823dcac025709a67..38467be4b5248115cf7c30e244dc425e999a1171 100644 (file)
@@ -26,6 +26,16 @@ jsToolBar.prototype.elements.em = {
   }
 }
 
+// u
+jsToolBar.prototype.elements.ins = {
+  type: 'button',
+  title: 'Underline',
+  shortcut: 'u',
+  fn: {
+    wiki: function() { this.singleTag('<u>', '</u>') }
+  }
+}
+
 // del
 jsToolBar.prototype.elements.del = {
   type: 'button',
index c689f6d9b60408882869ceb8e2dd9596ef929c16..cdefc372bb806e076427a58f886e455cbd7ad745 100644 (file)
@@ -111,6 +111,9 @@ module Redmine
             end
           }
 
+          # Allow `u` element to enable underline
+          allowlist[:elements].push('u')
+
           allowlist
         end
       end