A platform for community discussion. Free, open, simple.
DEV: Replace `starts_with?` with `start_with?` in `HtmlToMarkdown` (#24521)
Gerhard Schlager5b97f79569a4
diff --git a/lib/html_to_markdown.rb b/lib/html_to_markdown.rbindex 67626fd76e7..b0415718603 100644--- a/lib/html_to_markdown.rb+++ b/lib/html_to_markdown.rb@@ -157,7 +157,7 @@ class HtmlToMarkdownenddef visit_a(node)- if node["href"].present? && node["href"].starts_with?(*allowed_hrefs)+ if node["href"].present? && node["href"].start_with?(*allowed_hrefs)"[#{traverse(node)}](#{node["href"]})"elsetraverse(node)@@ -169,9 +169,9 @@ class HtmlToMarkdownif @opts[:keep_img_tags]node.to_html- elsif @opts[:keep_cid_imgs] && node["src"].starts_with?("cid:")+ elsif @opts[:keep_cid_imgs] && node["src"].start_with?("cid:")node.to_html- elsif node["src"].starts_with?(*ALLOWED_IMG_SRCS)+ elsif node["src"].start_with?(*ALLOWED_IMG_SRCS)title = node["alt"].presence || node["title"].presencewidth = node["width"].to_iheight = node["height"].to_i