Joe (erebrandir) wrote in lj_dev,
Joe
erebrandir
lj_dev

The HTML Nazi strikes again!

Abstract

The HTML cleaner is still cleaning a lot of HTML elements out of comments/responses that are non-harmful and useful to users. I'd like to add them to the list of accepted elements.

Introduction

While replying to some comments this morning, it hit me that the HTML cleaner is still cleaning elements out of comments that ought not to be cleaned. So I checked on it.

Group 1 – HTML 4.01 elements that are currently being cleaned: ABBR ACRONYM ADDRESS APPLET AREA BASE BASEFONT BDO BODY BUTTON CAPTION COL COLGROUP DEL DFN DIR FIELDSET FORM FRAME FRAMESET H4 H5 H6 HEAD HTML IFRAME INPUT INS ISINDEX KBD LABEL LEGEND LINK MAP MENU META NOSCRIPT OBJECT OPTGROUP OPTION PARAM Q SAMP SCRIPT SELECT STYLE TBODY TEXTAREA TFOOT THEAD TITLE VAR

Group 2 – HTML 4.01 Elements that are being cleaned that I can see a good reason for cleaning: APPLET BASE BASEFONT BODY BUTTON FIELDSET FORM FRAME FRAMESET HEAD HTML IFRAME INPUT ISINDEX LABEL LEGEND LINK META NOSCRIPT OBJECT OPTGROUP OPTION PARAM SCRIPT SELECT STYLE TITLE TEXTAREA

Group 3 – HTML 4.01 Elements that are being cleaned that are non-harmful and potentially useful: ABBR ACRONYM ADDRESS AREA BDO CAPTION COL COLGROUP DEL DFN H4 H5 H6 INS KBD MAP Q SAMP TBODY TFOOT THEAD VAR

This includes:

  • Most of the phrase elements: ABBR, ACRONYM, DFN, KBD, SAMP, VAR. —Very useful.
  • Inline quotations: Q. —Useful.
  • Many of the HTML 4 table elements: CAPTION, COL, COLGROUP, TBODY, TFOOD, THEAD. —Useful.
  • The lower end of the headings: H4, H5, H6. —Useful.
  • The document change elements: DEL, INS. —Don't see why anybody would need these, but don't see any reason to exclude them, either.
  • The image map elements: AREA, MAP. —If we're going to allow IMG, I see no reason to exclude these.
  • The address element: ADDRESS. —Why not?
  • The BiDi override: BDO. —I don't know much about how this works, but it seems to me that it might be useful for the non-English users, and I see no reason to exclude it.

Proposal

As I see no reason why the use of these elements should be prohibited, I would like to have each of these Group 3 elements approved and enabled for use in comments.

Patch: livejournal/cgi-bin/cleanhtml.pl

In the event that there are no objections to these additions, here is a patch adding all Group 3 elements to cleanhtml.pl's @comment_close and @comment_ok arrays.

cleanhtml.pl.126.diff

Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 16 comments