html - Turn Nokogiri XML object to string without using .text -
i have object child of < td >
tag. class ctext
, relevant data within < b >
tag.tag
i have selected node using:
td.css(".ctext b")
and seems work. result of like:
< b >flying< br >< br >at beginning of each combat, choose first strike, vigilance, or lifelink. creatures control gain ability until end of turn.< /b >
if use:
td.css(".ctext b").text
to convert string, get:
flyingat beginning of each combat, choose first strike, vigilance, or lifelink. creatures control gain ability until end of turn.
what need able convert td.css(".ctext b")
, think nokogiri xml node string without stripping html tags. need keep < br >
s.
you want .inner_html
instead of .text
.
Comments
Post a Comment