DEV: Add additional_allowed_tags to HtmlToMarkdown

Import script often use subclasses of `HtmlToMarkdown` and might need to allow additional tags that can be used within the custom class.
This commit is contained in:
Gerhard Schlager
2024-06-09 12:51:23 +02:00
committed by Gerhard Schlager
parent 1a42249bd8
commit b8f2cbf41c
2 changed files with 38 additions and 1 deletions

View File

@ -26,7 +26,7 @@ class HtmlToMarkdown
end
def remove_not_allowed!(doc)
allowed = Set.new
allowed = Set.new(@opts[:additional_allowed_tags] || [])
HtmlToMarkdown.private_instance_methods.each do |m|
if tag = m.to_s[/^visit_(.+)/, 1]