- This topic has 6 replies, 3 voices, and was last updated 19 years, 4 months ago by rshendershot.
-
AuthorPosts
-
frantumaMemberI am using the ‘format’ capability of MyEclipse XML-HTML editor by right clicking -> format -> document.
My goal is to format the code to have its tags properly indented and nothing else.
What happens when I use format is that it indents my code but it performs some not necessary and actually wrong formatting for which I haven’t found any setting.
For example it transform the line:
<a href=# onclick=window.open('/gol/info_point/risposta.jhtml?id=2008&mod=help','Help','width=580,height=250,toolbar=no,scrollbars=yes,resizable=yes');>
into the following multi-line with additional wrong spaces
<a href=# onclick=window.open( '/ gol / info_point / risposta.jhtml ? id=2008&mod=help ',' Help ',' width=580,height=250,toolbar=no,scrollbars=yes,resizable=yes ');>
or it split some text into several lines, which corrupts my code
this is a testà
which would be rendered as
this is a testà
gets transformed into
this is a test& agrave;
which is rendered as
this is a test à
Question is if and where there is a place where to configure these settings or if there is a template to change or anyhow how to change this behaviour.
Thanks
Riyad KallaMember<a href=# onclick=window.open(‘/gol/info_point/risposta.jhtml?id=2008&mod=help’,’Help’,’width=580,height=250,toolbar=no,scrollbars=yes,resizable=yes’);>
You gotta quote that HREF my friend… that’s one mean href 😉
this is a testà
I couldn’t reproduce this… it might be a side effect of your HREF above freaking out the formatter.
Riyad KallaMemberAlso you can use “Cleanup” on the document to quote unquoted values so the formatter doesn’t mangle them.
frantumaMemberI am working on a large set of jhtml files in which (unfortunately) most of attrs are NOT quoted. I am not so confortable in having a tool do the work of quoting them (Cleanup) because there is no way I can check them all afterwards before deploying the updated set to production. And it’s actually impossible to do the work manually due to the amount of files/tags/attrs to elaborate. But I understand the parser can get confused, I was wandering if there was some “template file” one can modify to change the behaviour of the format.
The second quote is not related to the href; it is (just an example) posititoned after a br and before another:
..code here.. <br> Unità <br> ..code here..
and after the format I get
..code here.. <br> Unit à <br> ..code here..
this happens for normal spaces as well
If it’s not possible to get the hands on the fromat configuration, is there anyway to tell the formatter just to do indentation and leave the rest untouched?
Thanks
Riyad KallaMemberI still can’t reproduce the agrave problem:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>MyHtml.html</title> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="this is my page"> <!--<link rel="stylesheet" type="text/css" href="./styles.css">--> </head> <body> This is my HTML page. <br> <br> Unità <br> </body> </html>
This is my page…
Also no there is no template to fix, or formatting rule to make it less abusive… I’ll file an enhancement though (the formatting code is *insanely* complicated, so this won’t be just a quick fix), but I’ll see if we can get it into 3.8.3… no promises.
In the mean time, can you edit the HTML Source settings and make the “Line Width” like 512, and see if it stops tryign to break things across multiple lines?
frantumaMemberI set the Line width to 512 already actually, but still it wants to split lines.
Thanks for looking into it, I hoped there was a kind ov voice command “Do that!” for the formatter.. 🙂
I’ll try anyway to use the cleanup and hope nothing breaks and then see if I get the same problem again.
Thank you
rshendershotMemberI made an HTML template to match (NES) server-side dynamic html which uses
<server></server>
tags to indicate javascript that will execute on the server. I cannot use the HTML formatter since (though improved greaty with 3.9.211 – thanks!) it will compress this all together.
Shouldn’t the formatter apply templates to HTML that it (should) recognize(s) ???
-rsh
-
AuthorPosts