Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commitcf7f3c6

Browse files
author
mydearxym
committed
Merge branch 'editor-parser' ofhttps://github.com/coderplanets/coderplanets_server into editor-parser
2 parents78dd836 +a971255 commitcf7f3c6

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

‎lib/helper/rich_text_parser.ex‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ defmodule Helper.RichTextParser do
1818
end)
1919

2020
"<div class=\"#{@html_class_prefix}\">#{content}<div>"
21-
#|> IO.inspect(label: "hello")
21+
|>IO.inspect(label:"hello")
2222
end
2323
end
2424

@@ -93,7 +93,7 @@ defmodule Helper.RichTextParser do
9393
defpparse_block(%{"type"=>"linkTool","data"=>data})do
9494
link=get_in(data,["link"])
9595

96-
"<div class=\"#{@html_class_prefix}-linker\"><asrc=\"#{link}\" target=\"_blank\" /></div>"
96+
"<div class=\"#{@html_class_prefix}-linker\"><ahref=\"#{link}\" target=\"_blank\">#{link}</a></div>"
9797
# |> IO.inspect(label: "linkTool ret")
9898
end
9999

‎lib/helper/sanitizer.ex‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ defmodule Helper.Sanitizer do
1414
Meta.strip_comments()
1515

1616
Meta.allow_tag_with_uri_attributes("a",["href"],["http","https"])
17-
Meta.allow_tag_with_these_attributes("a",["name","title"])
17+
Meta.allow_tag_with_these_attributes("a",["name","title","class"])
1818

1919
# Meta.allow_tag_with_these_attributes("strong", [])
2020
# Meta.allow_tag_with_these_attributes("em", [])
@@ -23,6 +23,18 @@ defmodule Helper.Sanitizer do
2323
Meta.allow_tag_with_these_attributes("mark",["class"])
2424
Meta.allow_tag_with_these_attributes("code",["class"])
2525
# Meta.allow_tag_with_these_attributes("p", [])
26+
Meta.allow_tag_with_these_attributes("h1",["class"])
27+
Meta.allow_tag_with_these_attributes("h2",["class"])
28+
Meta.allow_tag_with_these_attributes("h3",["class"])
29+
Meta.allow_tag_with_these_attributes("h4",["class"])
30+
Meta.allow_tag_with_these_attributes("h5",["class"])
31+
Meta.allow_tag_with_these_attributes("h6",["class"])
32+
Meta.allow_tag_with_these_attributes("p",["class"])
33+
Meta.allow_tag_with_these_attributes("img",["class","src"])
34+
Meta.allow_tag_with_these_attributes("div",["class"])
35+
Meta.allow_tag_with_these_attributes("ul",["class"])
36+
Meta.allow_tag_with_these_attributes("ol",["class"])
37+
Meta.allow_tag_with_these_attributes("li",["class"])
2638

2739
Meta.strip_everything_not_covered()
2840
end

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp