Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/lexxy/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/config/dom_purify.js
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]

Expand Down
10 changes: 10 additions & 0 deletions test/system/load_html_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ class LoadHtmlTest < ApplicationSystemTestCase
assert_editor_html "<p>hello</p><p>there</p>"
end

test "load ordered list with start attribute" do
find_editor.value = '<ol start="3"><li>Third</li><li>Fourth</li></ol>'

assert_editor_html do
assert_selector "ol[start='3']"
assert_selector "li", text: "Third"
assert_selector "li", text: "Fourth"
end
end

test "load attachment with custom tag" do
visit new_post_path(attachment_tag_name: "bc-attachment")

Expand Down
Loading