mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
FIX: Allow disabling of sanitization (for email customiaztions)
This commit is contained in:
parent
6507246e97
commit
414388b94f
1 changed files with 8 additions and 1 deletions
|
@ -156,7 +156,14 @@ module PrettyText
|
||||||
Emoji.custom.map {|e| custom_emoji[e.name] = e.url}
|
Emoji.custom.map {|e| custom_emoji[e.name] = e.url}
|
||||||
context.eval("__optInput.customEmoji = #{custom_emoji.to_json};")
|
context.eval("__optInput.customEmoji = #{custom_emoji.to_json};")
|
||||||
|
|
||||||
opts = context.eval("__pt = new __PrettyText(__buildOptions(__optInput));")
|
context.eval('__textOptions = __buildOptions(__optInput);')
|
||||||
|
|
||||||
|
# Be careful disabling sanitization. We allow for custom emails
|
||||||
|
if opts[:sanitize] == false
|
||||||
|
context.eval('__textOptions.sanitize = false;')
|
||||||
|
end
|
||||||
|
|
||||||
|
opts = context.eval("__pt = new __PrettyText(__textOptions);")
|
||||||
|
|
||||||
DiscourseEvent.trigger(:markdown_context, context)
|
DiscourseEvent.trigger(:markdown_context, context)
|
||||||
baked = context.eval("__pt.cook(#{text.inspect})")
|
baked = context.eval("__pt.cook(#{text.inspect})")
|
||||||
|
|
Loading…
Reference in a new issue