1

I am doing some HTML parsing and I would like to convert some content I get to textile counterparts.

<li> -> *
<b>, <strong> -> **

etc...

and strip others (not permitted html tags)

I have a table plugin in my textile editor (that defines rows and columns with | )

I tried this html2textile class but it is not doing the job well I also stumbled upon this STackOverflow's question: How can I convert HTML to Textile?

They suggested a link to a blog with (now) empty article, no content, so it was not helpful

Community
  • 1
  • 1
DS_web_developer
  • 3,622
  • 13
  • 52
  • 83
  • If I understand your question, did not you try passing your HTML through the function "strip_tags()" It has multiple option to to pass selected tags and strip out some other. You can refer to the manual for more information. http://php.net/manual/en/function.strip-tags.php – Muneer Jan 07 '12 at 08:47
  • I am doing ok the html sripping part, the problem is html->textile – DS_web_developer Jan 07 '12 at 08:48

1 Answers1

0

There are plenty of Ruby and Python examples but for PHP your best bet is to debug the html2textile class you linked to and improve it. There are really no other PHP examples other than the blank CakePHP example.

davidethell
  • 11,708
  • 6
  • 43
  • 63