[Webkit-unassigned] [Bug 76707] Two HTML line breaks are generated with XSL transformation of <br/>

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jan 22 22:18:41 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=76707





--- Comment #12 from Rob S. <RobS.webkit6 at MailScreen.com>  2012-01-22 22:18:40 PST ---
Created an attachment (id=123521)
 --> (https://bugs.webkit.org/attachment.cgi?id=123521&action=review)
Files for test cases - see comment

I created a workaround using the stylesheet rather than having to use JavaScript.  The stylesheet uses this template to transform the <br> elements into new lines:

   <xsl:template match="html:br">
      <span>
         <xsl:apply-templates select="@*"/>
         <span style="white-space: pre">&#x200a;
</span>
      </span>
   </xsl:template>

Curiously, <hr/> elements do _not_ get transformed to <hr><hr> - horizontal lines appear just once as expected and therefore the workaround is not needed for <hr/> elements.

A working example with the workaround:  http://www.ExampleOnly.com/br-tag/test3.html

As requested, I have uploaded the test case files as brtag.zip.  The files that archive contains are:

test.html - simple test case, single spaced in Firefox, double spaced in Safari, Chrome, etc.
test.xsl - xsl:stylesheet with <xsl:output method="html"/> for test.html and test1.html
test1.html - same as test.html with alerts that show object types
test2.html - test that uses <xsl:output method="xml"/> in test2.xsl - JavaScript does not work in Firefox due to undefined objects
test2.xsl - xsl:stylesheet with <xsl:output method="xml"/>
test3.html - test that uses <xsl:output method="html"/> and workaround that replaces <br/> elements with new lines
test3.xsl - xsl:stylesheet with a template that transforms <br> elements to new lines

Thanks much for all the help.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list