This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Mixed content (php+html+js) seems to puzzle the autoformater. I have no clue where or when this happens but on some sources html-tags and js-functions get destroyed to e.g. < button type="button" onclick="scale(7);" title="Week">7</button> <but ton type="button" onclick="scale(30);" title="month">30</button> <button type="button" onclick="zoom(-0.2);" title="more"><i class="fa fa-lg fa-search-plus"></i></button> or top.timeline = new vis.Timeline(container, new vis.DataSet([<?= implode(',', getCalendarEntries()); ?>]), new vis.DataSet([<?= implode(',', $fz); ?>]), timelineOption s); You can see the added Spaces/Tabs inside tags or function calls which destroys the sourcecode!
Would be great if you could attach a sample file. Reassigning to HTML, please evaluate. Thanks.
Created attachment 162427 [details] Formting settings in nb maybe this is relevant?
Created attachment 162428 [details] File with false formating just a demo, much source code was removed to get some kind of minimal example
I've added an (reduced) example attached where autoformater destroys the source code. If you format the source once you get at least a line <button type="button" onclick="scale(1);" title="Tagesansicht">1</but ton> Maybe there are other faulty formats if you do this again you get these lines: <bu tton type="button" onclick="scale(30);" title="Monatansicht">30</button> <but ton type="button" onclick="zoom(-0.2);" title="mehr Details"><i class="fa fa-lg fa-search-plus"></i></button> and </s crip t> <div id="newEntry" style="di splay:none "> <fo rm name="newEntry "> <table class="editTable sta ndard"> and some more.... (if relevant, I found many places where nb 8.2 does indentations and formating very different even in full php-source, e.g. missing indentation on ternary operators)
do you have anything new about this? The main problem is, the changes are applied and you don't see that the code is broken. You get this only by testing. But if you change a comment, do a reformat on save or manual, you don't expect the code to be broken and won't test it.
since this is a severe bug, changed priority to data-loss, since formating causes data-loss.
Shouldn't this be indented by smarty template? I am sending this for investigation.
The file is manage.tmpl - what is *.tmpl? What MIME type do you use? PHP? Smarty? Any other one? Simply reopen this issue, thanks.
tmpl stands for "template" can be a mixture of html/js/php code. Every code segment is opened by the specific html-tags. But no matter what the file format is or what it is recognized, tags should never break.
(In reply to Tomas Mysik from comment #8) > What MIME type do you use? PHP? Smarty? Any other one? Again, I need to know the MIME type you have set for this file extension. Thanks.
I never set any mime type to this file extension. If you mean the uderlying os, it reports: $ file test.tmpl test.tmpl: PHP script, UTF-8 Unicode text, with very long lines, with CRLF line terminators So I expect nb to handle the source as php
So, I opened the file you have attached, verified that it has PHP MIME type and tried to format it. I got an error, see my attachment. So reassigning to HTML, please evaluate. Thanks. Product Version: NetBeans IDE Dev (Build 20170327-41b3145bc1cc) Java: 1.8.0_121; Java HotSpot(TM) 64-Bit Server VM 25.121-b13 Runtime: Java(TM) SE Runtime Environment 1.8.0_121-b13 System: Linux version 4.8.0-42-generic running on amd64; UTF-8; cs_CZ (nb)
Created attachment 163956 [details] Error