Autocomplete HTML

For general web development questions that are not specifically related to CSS HTML Validator. This includes (but is not limited to) general HTML, CSS, Accessibility, JavaScript, and SEO questions.
Post Reply
cyberfriend

Autocomplete HTML

Post by cyberfriend »

I would like to know if there's a way to "autocomplete" the purified HTML. Meaning, if there's no doctype tag and such (html, head, body, etc) in the HTML provided, can HTML Purifier "autocomplete" the provided HTML ?

Basically, I'm parsing emails, and since not all of them have fully standarized HTML parts and I need them to be so, I thought that maybe HTML Purifier could do that automagically for me.

Thanks in advance and keep up the good work ;)

PS: I thought of using this, but didn't do the trick...

$config->set('HTML', 'Doctype', 'XHTML 1.0 Transitional'); $config->set('HTML', 'TidyLevel', 'heavy');
User avatar
MikeGale
Rank VI - Professional
Posts: 726
Joined: Mon Dec 13, 2004 1:50 pm
Location: Tannhauser Gate

Post by MikeGale »

By Purifier I take it you mean the
Tools -> Format and Fix HTML
action.

I gave it a quick try with my configuration and found that it does what you are asking. No further setup, no nothing it just works.

See below what was added:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>

<body>

P.S. I didn't understand what
$config->set('HTML', 'Doctype', 'XHTML 1.0 Transitional'); $config->set('HTML', 'TidyLevel', 'heavy');
means. That looks like setup for something other than CSE HTML Validator!
User avatar
Albert Wiersch
Site Admin
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX
Contact:

Post by Albert Wiersch »

I am not sure what you mean by "HTML Purifier" but CSE HTML Validator Std/Pro includes a "Format and Fix HTML" tool that uses HTML Tidy to do similar things to what you are asking. Note that this tool is not in the lite edition, but you can download the HTML Tidy program by itself for free:
http://tidy.sourceforge.net/

As Mike said, the $config->set options must be related to something other than CSE HTML Validator.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
ezyang
Rank 0 - Newcomer
Posts: 2
Joined: Tue Jul 15, 2008 9:18 am

Post by ezyang »

Hello,

This is the lead developer of HTML Purifier, the application he is referring to in his post. I suspect this is a spam post, as it is an almost exact repost of a legitimate issue someone else previously had on our forums. The signature links are spammy, as well.

P.S. I would normally assume good faith, but a similar "spammy" re-post was made on our forums under the same username.
User avatar
MikeGale
Rank VI - Professional
Posts: 726
Joined: Mon Dec 13, 2004 1:50 pm
Location: Tannhauser Gate

Post by MikeGale »

If you want to punish those who pay for spam, put these values in your hosts file

127.0.0.1 www DOT worthingtonmillwork DOT com
127.0.0.1 www DOT manhattanflameproofing DOT com

(With the obvious adjustments this will prevent access to these sites. )

Only use this technique if you know what you're doing!

If you document (recommended) it might look like:

# Punish spammers

#2008-07-16 spammed CSE web forum under name cyberfriend wasted my time.
127.0.0.1 ...
127.0.0.1 ...
ezyang
Rank 0 - Newcomer
Posts: 2
Joined: Tue Jul 15, 2008 9:18 am

Post by ezyang »

Hmm... I don't really understand what that would do to the spammers. They're usually after increased pagerank in Google/visibility, and blackholing their DNS entry in your HOSTs file doesn't really change much...
User avatar
MikeGale
Rank VI - Professional
Posts: 726
Joined: Mon Dec 13, 2004 1:50 pm
Location: Tannhauser Gate

Post by MikeGale »

It stops me ever going to the site of those who paid for the spammer.

If it gets into one of the hosts block lists, like that MVP list, it does more widespread damage to the reachability of the domain in question.

When the spam sponsors find out they are likely to stop paying for spam and drop this little cyberfiend. Plus tell others about it.

A lot of people have given up taking retribution on these cursed humans. Some haven't.

Thanks very much for pointing out what's going on here.
Post Reply