@nertc commented on this pull request.
> @@ -65,6 +65,32 @@ def description
protected
+ def truncate_html(html_doc, max_length = nil, empty_tag_length = 1000)
+ return html_doc if max_length.nil?
+
+ doc = Nokogiri::HTML::DocumentFragment.parse(html_doc)
+ accumulated_length = 0
+ last_child = nil
+
+ doc.traverse do |node|
Added `keep_or_discards` array which contains tag names which will be either
completely kept or completely discarded.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5121#discussion_r2007891937
You are receiving this because you are subscribed to this thread.
Message ID:
<openstreetmap/openstreetmap-website/pull/5121/review/2706488...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev