diff --git a/lib/lexxy/engine.rb b/lib/lexxy/engine.rb index f02b983e..c06a3791 100644 --- a/lib/lexxy/engine.rb +++ b/lib/lexxy/engine.rb @@ -39,7 +39,7 @@ class Engine < ::Rails::Engine ActionText::ContentHelper.allowed_tags = default_allowed_tags + %w[ video audio source embed table tbody tr th td ] default_allowed_attributes = Class.new.include(ActionText::ContentHelper).new.sanitizer_allowed_attributes - ActionText::ContentHelper.allowed_attributes = default_allowed_attributes + %w[ controls poster data-language style ] + ActionText::ContentHelper.allowed_attributes = default_allowed_attributes + %w[ controls poster data-language start style ] Loofah::HTML5::SafeList::ALLOWED_CSS_FUNCTIONS << "var" # Allow CSS variables end diff --git a/src/config/dom_purify.js b/src/config/dom_purify.js index 62d4bfb9..cea443bb 100644 --- a/src/config/dom_purify.js +++ b/src/config/dom_purify.js @@ -7,7 +7,7 @@ const ALLOWED_HTML_TAGS = [ "a", "b", "blockquote", "br", "code", "div", "em", const ALLOWED_HTML_ATTRIBUTES = [ "alt", "caption", "class", "content", "content-type", "contenteditable", "data-direct-upload-id", "data-sgid", "filename", "filesize", "height", "href", "presentation", - "previewable", "sgid", "src", "style", "title", "url", "width" ] + "previewable", "sgid", "src", "start", "style", "title", "url", "width" ] const ALLOWED_STYLE_PROPERTIES = [ "color", "background-color" ] diff --git a/test/system/load_html_test.rb b/test/system/load_html_test.rb index 8c4cd0b1..ec6f1c0c 100644 --- a/test/system/load_html_test.rb +++ b/test/system/load_html_test.rb @@ -18,6 +18,16 @@ class LoadHtmlTest < ApplicationSystemTestCase assert_editor_html "
hello
there
" end + test "load ordered list with start attribute" do + find_editor.value = '