Reputation: 5096
Let's say I am doing this:
entries.each do |entry|
entry[0,1000] + "..."
end
Let's say that entry has a <ul> and a <li> that were not closed, because it chopped the entry in the middle of a list. How can I make sure to close those tags out, so rendering isn't messed up?
I was considering creating a method that found the last index of <ul> and made sure it was less than the last index of </ul>, etc. This seems cumbersome though. Any ideas on how to solve this with ruby on rails?
Thanks!
Upvotes: 1
Views: 124