A platform for community discussion. Free, open, simple.
Revert "DEV: Add logging for stack level too deep exception in HtmlToMarkdown"
Daniel Waterworth3b368a48d18d
diff --git a/lib/html_to_markdown.rb b/lib/html_to_markdown.rbindex fc36861a4be..d2fb51f34c8 100644--- a/lib/html_to_markdown.rb+++ b/lib/html_to_markdown.rb@@ -6,30 +6,21 @@ require "securerandom"class HtmlToMarkdowndef initialize(html, opts = {})- @html = html@opts = opts# we're only interested in <body>@doc = Nokogiri::HTML5(html).at("body")- end- def to_markdownremove_not_allowed!(@doc)remove_hidden!(@doc)hoist_line_breaks!(@doc)remove_whitespaces!(@doc)+ end+ def to_markdowntraverse(@doc).gsub(/\n{2,}/, "\n\n").strip- rescue SystemStackError => e- Discourse.warn_exception(- e,- message: "stack level too deep in HtmlToMarkdown",- env: { html: @html },- )-- raiseendprivate