Ticket #13871 (new Bug)

Opened 2 years ago

Last modified 2 years ago

HTML validation breaks when using diazo and description contains linefeeds

Reported by: bosim Owned by:
Priority: minor Milestone: 4.x
Component: Unknown Version: 4.3
Keywords: Cc:

Description (last modified by bosim) (diff)

When using diazo or probably also any other libxml transformation the HTML(5) transformation will break if the description field contains linefeed. This applies for both meta description, title attributes on links, and probably also many other places.

Example:

<meta name="description" content="test test test&#13;&#10;test test test" />

Steps to reproduce:

  • Ensure you are using a diazo theme and dexterity content types,
  • Add a new page,
  • Fill in the description field, ensure it contains line feeds,
  • Look at the meta description.

We tried fixing this error but it seems like it happens in libxml, so we used an ITransform adapter (code:  http://pastebin.com/x3iE0F49) for fixing it.

Ideally the bug should be fixed in libxml, but I expect in some situations this behavior is desirable. Validation on the description field is of course also an option, preferably for IBasic. I have not tested if the problem exists for Archetypes-based content types as well.

Change History

comment:1 Changed 2 years ago by bosim

  • Description modified (diff)
Note: See TracTickets for help on using tickets.