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?
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
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?
Modules
http://drupal.org/project/htmlcorrector
http://drupal.org/project/htmlpurifier
http://drupal.org/project/htm
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
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
a module would be great indeed :)
htmLawed module is now available
The htmLawed module is now available.
Nope
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.