HTML input correction

Ilya1st - January 17, 2008 - 12:14

Are there ways to correct users HTML on the fly while users input their html content? to close non closed tags, etc?

html correction as i see them

Ilya1st - January 17, 2008 - 12:31

htmltidy - requires exec() on server. not save. requires third party.

safehtml -my patch waits for approval - requires library but can be shipped normally. bad support - patched myself version I use now

htmlcorrector - stupid correction algorithm - make mistaces while tags intersections. html correction algorithm in wordpress makes it better.

So is anything else normally working out of the box?

http://drupal.org/project/htm

Ilya1st - January 17, 2008 - 13:18

http://drupal.org/project/htmlpurifier is to slow for high load
look at the code.
about corrector I've wrote above.

Looks like community does not see a problem. All other CMS I know correct html while user inputs

htmLawed, but no module

alpha2zee - February 8, 2008 - 04:11

htmLawed is another HTML filter library like HTMLPurifier, but there is no Drupal module yet (maybe I should write one). Unlike HTMLPurifier, it is not resource-intensive (only one 45 kb file and basal peak memory usage of 4-500 kb) and it can be set to permit 'unsafe' HTM like 'script' if an admin wants to. It also can do (and do better) what the core Drupal filter module does in terms of HTML filtering/purification, so a module may help all.

a module would be great

guardian - February 22, 2008 - 21:13

a module would be great indeed :)

htmLawed module is now available

alpha2zee - May 4, 2008 - 23:26

The htmLawed module is now available.

Nope

yelvington - February 23, 2008 - 03:01

The Drupal approach is to store exactly what the user inputs, and filter on output. That sounds like a potential load issue but it is not, because filtered output is cached. For any given node, the purifier is run only once within the cache lifetime.

This approach ensures that information is not discarded, as would happen if you filtered on input.

 
 

Drupal is a registered trademark of Dries Buytaert.