Is there a way to edit the text of a nokogiri element? I have a nokogiri element that contains a list element (<li>
) and I would like to remove some characters from the text while preserving the <li>
html. Specifically, I want to remove a leading ":" character in the text if it exists. It doesn't look like there's a text= method for nokogiri elements, but I just wanted to make sure.
Maybe I will have to use regular expressions? If so, how would I remove a leading ":" if it looks something like:
<li>: blah blah blah</li>
p.s. I am using ruby.