@nertc commented on this pull request.


> +      if accumulated_length >= max_length
+        node.remove unless !last_child.nil? && 
last_child.ancestors.include?(node)
+        next
+      end
+
+      next unless node.children.empty?
+
+      accumulated_length += node.text? ? node.text.length : empty_tag_length
+      if accumulated_length < max_length
+        last_child = node
+      else
+        node.remove
+      end
+    end
+
+    RichText::SimpleFormat.new.sanitize(doc)

Thank you for the review. PR was updated. From now, sanitization doesn't need 
to be run more than one time.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5121#discussion_r1916349335
You are receiving this because you are subscribed to this thread.

Message ID: 
<openstreetmap/openstreetmap-website/pull/5121/review/2552224...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to