developer.jelix.org is not used any more and exists only for history. Post new tickets on the Github account.
developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Opened 11 years ago

Closed 11 years ago

#899 closed bug (fixed)

jFilter: cleaned up HTML code should be XHTML compliant

Reported by: Julien Owned by: Julien
Priority: normal Milestone: Jelix 1.1.4
Component: jelix:utils Version: trunk
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Documentation needed: no
Hosting Provider: Php version:

Description

When using a jForm with an HTML editor, <br /> tags are outputted <br>, making the result invalid.

Here's a simple patch to solve this.

Attachments (1)

899-jFilter-cleaned-up-HTML-code-should-be-XHTML-compliant.diff (1.3 KB) - added by Julien 11 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 Changed 11 years ago by Julien

  • Status changed from new to assigned

Note : we need to remove \r chars to avoid them being converted to entities &#13; (it's automatically done in the method DOMDocument::loadXML() )

comment:2 Changed 11 years ago by Julien

Hum, another idea...

maybe we could have <htmleditor> and <xhtmleditor> in jForms ?

and jDatatypeHtml and jDatatypeXhtml ?

so we could use specific functions for them.

Maybe we could also specify a strict attribute ? Default will of course be true. (I know it's bad, but some people still want some target="_blank" in their page. With attribute's value "no", we'll keept it)

If you think it's a good idea, then I'll write a patch.

comment:3 Changed 11 years ago by laurentj

  • Resolution set to fixed
  • review review? deleted
  • Status changed from assigned to closed

I improved things:

  • we can now use <input type="xhtml"> and <htmleditor xhtml="true"> to have xhtml content
  • jFilter::cleanHtml accepts now a boolean : true if we want xhtml content. (DOMDocument::loadHtml accepts html or xhtml as input)

Fixed in trunk and 1.1.x branch.

Note: See TracTickets for help on using tickets.