Page MenuHomePhabricator

Empty XHTML tag br in mobile view
Closed, ResolvedPublic

Description

Author: enomil

Description:
In mobile view the empty Tag <br /> is replaced with <br></br>, but in HTML 4 the br end tag is forbidden [1]. This causes errors in some user agents (interpreted as double line break). Not tested for other valid empty XHTML tags.

[1] http://www.w3.org/TR/html4/struct/text.html#h-9.3.2.1


Version: unspecified
Severity: normal

Details

Reference
bz36018

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 12:18 AM
bzimport set Reference to bz36018.
bzimport added a subscriber: Unknown Object (MLST).

This is a particularly noticeable problem for the poem extension (thus the Wikisource tracker) as can be seen here: http://de.m.wikisource.org/w/index.php?title=An_den_Fr%C3%BChling_(Schiller)&mobileaction=toggle_view_mobile, N.B. the double-spacing between lines of the poem. cf. http://de.wikisource.org/wiki/An_den_Fr%C3%BChling_%28Schiller%29

enomil wrote:

The main problem is in the HtmlFormatter.php on line 220: $html = $this->doc->saveXML( $element, LIBXML_NOEMPTYTAG ); This generates valid XML with expanded empty tags (<br /> -> <br></br>, valid but confusing) but not HTML (see Comment 0 above).

There are two ways to solve the issues. 1. use XHTML on MobileFrontend or 2. stript the closing elements for valid HTML.

Other empty tags with forbidden end tag are: area, base, basefont, col, frame, hr, img, input, isindex, link, meta, param [1]. But I guess not all affect the generated layout so much.

[1] http://www.w3.org/TR/html4/index/elements.html

enomil wrote:

*** Bug 36072 has been marked as a duplicate of this bug. ***