File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
app/assets/javascripts/discourse/app/static/prosemirror/extensions Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,10 @@ const extension = {
32
32
isolating: true,
33
33
content: "inline*",
34
34
attrs: { tag: {} },
35
- parseDOM: ALLOWED_INLINE.map((tag) => ({ tag })),
35
+ parseDOM: ALLOWED_INLINE.map((tag) => ({
36
+ tag,
37
+ getAttrs: () => ({ tag }),
38
+ })),
36
39
toDOM: (node) => [node.attrs.tag, 0],
37
40
},
38
41
},
Original file line number Diff line number Diff line change @@ -760,7 +760,7 @@ def body(title)
760
760
expect(composer).to have_value("")
761
761
end
762
762
763
- it "should correctly merge text with link marks created from parsing" do
763
+ it "merges text with link marks created from parsing" do
764
764
cdp.allow_clipboard
765
765
open_composer
766
766
@@ -773,6 +773,21 @@ def body(title)
773
773
774
774
expect(rich).to have_css("a", text: "lin")
775
775
end
776
+
777
+ it "parses html inline tags from pasted HTML" do
778
+ cdp.allow_clipboard
779
+ open_composer
780
+
781
+ cdp.copy_paste("<mark>mark</mark> my <ins>words</ins> <kbd>ctrl</kbd>", html: true)
782
+
783
+ expect(rich).to have_css("mark", text: "mark")
784
+ expect(rich).to have_css("ins", text: "words")
785
+ expect(rich).to have_css("kbd", text: "ctrl")
786
+
787
+ composer.toggle_rich_editor
788
+
789
+ expect(composer).to have_value("<mark>mark</mark> my <ins>words</ins> <kbd>ctrl</kbd>")
790
+ end
776
791
end
777
792
778
793
describe "toolbar state updates" do
You can’t perform that action at this time.
0 commit comments