Skip to content

FIX: rich editor html_inline parseDOM not setting the tag attr #34175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 8, 2025
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ const extension = {
isolating: true,
content: "inline*",
attrs: { tag: {} },
parseDOM: ALLOWED_INLINE.map((tag) => ({ tag })),
parseDOM: ALLOWED_INLINE.map((tag) => ({
tag,
getAttrs: () => ({ tag }),
})),
toDOM: (node) => [node.attrs.tag, 0],
},
},
Expand Down
17 changes: 16 additions & 1 deletion spec/system/composer/prosemirror_editor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ def body(title)
expect(composer).to have_value("![image|244x66](upload://hGLky57lMjXvqCWRhcsH31ShzmO.png)")
end

it "should correctly merge text with link marks created from parsing" do
it "merges text with link marks created from parsing" do
cdp.allow_clipboard
open_composer

Expand All @@ -773,6 +773,21 @@ def body(title)

expect(rich).to have_css("a", text: "lin")
end

it "parses html inline tags from pasted HTML" do
cdp.allow_clipboard
open_composer

cdp.copy_paste("<mark>mark</mark> my <ins>words</ins> <kbd>ctrl</kbd>", html: true)

expect(rich).to have_css("mark", text: "mark")
expect(rich).to have_css("ins", text: "words")
expect(rich).to have_css("kbd", text: "ctrl")

composer.toggle_rich_editor

expect(composer).to have_value("<mark>mark</mark> my <ins>words</ins> <kbd>ctrl</kbd>")
end
end

describe "toolbar state updates" do
Expand Down
Loading