To participate you must create an account on apostrophenow.org. If you have already done so, click Login.

Ticket #500 (closed defect: fixed)

Opened 19 months ago

Last modified 13 months ago

Strip out FCK created empty elements <p>&nbsp;</p> at save()

Reported by: johnnyoffline Owned by: tboutell
Priority: minor Milestone: 1.5
Component: apostrophePlugin Version: 1.4
Keywords: aHtml, Toolkit, 1.5rc2 Cc: agilbert, boutell, jake, rickybanister, johnnyoffline, dordille, geoffd
Symfony version: 1.4

Description

Tom,

Can we get aHtml::simplify() to watch for and remove this specific scenario:

<element>&nbsp;</element>

Every single time I use FCK and hit return return delete delete type type type delete return, I am left with the above markup.

If I edited a heading the element will be an <Hx> tag.
Very often it's simply this:

<p>&nbsp;</p>

It creates accessibility issues according to webaim and it also just makes type layout look bad.

Change History

Changed 19 months ago by tboutell

  • owner changed from boutell to tboutell
  • status changed from new to accepted

FCK adds these because most of the browser rich text editors act completely crazy if you don't have this at the end of the document, btw. But stripping them out at save time should be possible yeah.

Changed 17 months ago by johnnyoffline

  • priority changed from minor to major
  • summary changed from FCK and aHtml::simplify() to Strip out FCK created empty elements <p>&nbsp;</p> at save()

Changed 16 months ago by geoffd

  • milestone changed from 1.4.2 to 1.5

Changed 14 months ago by geoffd

  • keywords Toolkit, 1.5rc2 added; Toolkit removed

This relates to ticket #494

Changed 14 months ago by rickybanister

  • priority changed from major to minor

Changed 13 months ago by tboutell

  • status changed from accepted to closed
  • resolution set to fixed

Implemented in [2975]:

Replace <p>&nbsp;</p> (generated by all the major browser RTEs, or possibly by FCK itself) with <br />.

There are other cases, like <h4>&nbsp;</h4> if you put a "blank line" between h4's, but I don't think we should change these because the visual impact of a br between two separte major heading elements is not the same as a "&nbsp; only" major heading element in between them. A deeper fix would be something like:

<h4>First line<br />Second line</h4>

But this change is not trivial to apply because we have to remove the closing and reopening of the neighboring h4's to merge them into one, and the styling of the site has to be written with the possibility of internal br's in headings in mind (often folks assume br won't appear in headings at all and give it a fixed height). More discussion is welcome.

Note: See TracTickets for help on using tickets.