Add Obsidian support to the link sanitation

This commit is contained in:
Jyri-Petteri Paloposki 2022-01-31 12:06:47 +02:00
parent d0d70efe52
commit a6d70a05a1

View file

@ -27,7 +27,7 @@ module RenderingHelper
config = relaxed_config config = relaxed_config
# add onenote and message protocols, allow a target # add onenote and message protocols, allow a target
a_href_config = relaxed_config[:protocols]['a']['href'] + %w(onenote message) a_href_config = relaxed_config[:protocols]['a']['href'] + %w[onenote message obsidian]
a_attributes = relaxed_config[:attributes]['a'] + ['target'] a_attributes = relaxed_config[:attributes]['a'] + ['target']
config = Sanitize::Config.merge(config, protocols: { 'a' => { 'href' => a_href_config } }, :attributes => { 'a' => a_attributes }) config = Sanitize::Config.merge(config, protocols: { 'a' => { 'href' => a_href_config } }, :attributes => { 'a' => a_attributes })