I’m having strange problems with source-code formatter in MyEclipse visual (X)HTML editors (both HTML and XHTML)….
I have an .xhtml file like this:
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
template="WEB-INF/templates/main-template.xhtml">
<p>
<a href="#" onclick='showSourceDialog("#code3");'>show code</a>
</p>
<p>
<a href="#" onclick='showSourceDialog("#code3");'>show code</a>
</p>
<p>
<a href="#" onclick='showSourceDialog("#code3");'>show code</a>
</p>
<p>
<a href="#" onclick='showSourceDialog("#code3");'>show code</a>
</p>
</ui:composition>
If I format it (CTRL-SHIFT-F) I get something like this:
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
template="WEB-INF/templates/main-template.xhtml">
<p>
<a href="#" onclick='showSourceDialog("#code3");'>show code</a>
</p>
<p>
<a href="#" onclick='showSourceDialog("#code3");'>show code</a>
</p>
<p>
<a href="#" onclick='showSourceDialog("#code3");'>show code</a>
</p>
<p>
<a href="#" onclick=
showSourceDialog("#code3");;
>show code</a>
</p>
</ui:composition>
As you see – strange things happen to the onclick attribute of the last A tag – it gets broken by the formatter (no quote characters, duplicated semicolon at the end)! At the start it’s EXACTLY the same as the ones above it – always last <a> gets broken…
My version of MyEclipse: Version: 7.5
Build id: 7.5-20090609