Forums | Admin

Discussion Forums: open-discussion

Start New Thread Start New Thread

 

By: Thomas Leitner
RE: Remove all HTML Tags [ reply ]  
2010-10-22 18:02
No, there is currently no such option. But you could traverse the built element tree and substitute all elements that have type :html_element with their child elements.

By: Garrett Heaver
Remove all HTML Tags [ reply ]  
2010-10-22 08:38
Hi Thomas, I see you closed out the bug I submitted. Nice one, thanks!

Just a quick question around HTML importing. Is there an option to have kramdown strip out any remaining html tags that it hasn't been able to convert? In my case I can see <div>'s still present after the call to doc.to_kramdown. I'm using a wysiwyg editor on the front end which unfortunately doesn't always generate the cleanest of HTML depending on the browser so there could possibly be other tags appearing from time to time! I guess I could always just post process the string with a regular expression but thought I'd ask first about additional HTML options within the importer.

I can see the following options right away:
:parse_block_html
:parse_span_html
:html_to_native

Thanks
Garrett