Are you sure HTMLpurifier is "too complex" for what you want to do?
(Originally Posted by http://htmlpurifier.org/docs
$dirty_htmlwould be the markup your users submit;$clean_htmlwould be the purified markup you save/use.)
Are you sure HTMLpurifier is "too complex" for what you want to do?
(Originally Posted by http://htmlpurifier.org/docs
$dirty_htmlwould be the markup your users submit;$clean_htmlwould be the purified markup you save/use.)
Last edited by traq; 05-25-2013 at 04:04 AM.
Adrian ~ facebook | gist/github
['66.215.156.37','208.75.149.97'] // ip,ip array!
"Take that sticker *off* your hat; you look stupid" --Wil Wheaton
djr33 (05-25-2013)
It's not as easy as you think, in my case. An ad content, in my case, already goes through a markdown and it's not just one $dirty_html that is called out. In my case, the html is echoed and it has two different components in it. I will need a professional help to make it work.
I am also wondering, how the purifier is going to help me with html tables. And... if it can, why can't I do the same thing through my markdown? Obviously the purifier is using something to straighten html tables, why can't I just take the same regex (or whatever) and just make it part of my markdown?
I'm sure it's possible to reverse-engineer HTMLpurifier and integrate the relevant parts with your code. I'm also sure that it would not be a "simpler" approach.
If you'd like to share further details - what user input you receive, how you need to process it, how it needs to be output/saved - I'd be happy to continue to help you find a solution.
Otherwise, if you want to hire someone, you're welcome to post in the Paid Work forum.
Adrian ~ facebook | gist/github
['66.215.156.37','208.75.149.97'] // ip,ip array!
"Take that sticker *off* your hat; you look stupid" --Wil Wheaton
traq
You may wander why I need that thing to be fixed so badly. Here's an example of a table based template a user posted on the site:
http://qwikad.com/0/posts/8-real-est...use-FAST-.html
That's why I want to perfect the whole table thing so that others could enjoy good looking templates and never encounter the ones that mess up the site.![]()
Last edited by qwikad.com; 05-26-2013 at 09:14 PM.
I guess I've taken the easiest way out for now. I've tried different lines and ended up with this one. It does what I want... for now:
Thanks everyone for your input!Code:$text = preg_replace( '/(s*<\/table\s*\/?>\s*)+/', "</table>", $text);
By the way, in the process I've discovered this site. Some of you (regex fans) may find it useful: http://regex101.com
Last edited by qwikad.com; 05-26-2013 at 10:03 PM.
Bookmarks