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

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -