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.

Bug 204693

Summary: error formatting on ' hr ' tag
Product: web Reporter: sc_dvp
Component: HTML EditorAssignee: David Konecny <dkonecny>
Status: RESOLVED WORKSFORME    
Severity: normal CC: mfukala
Priority: P3    
Version: 7.0.1   
Hardware: PC   
OS: Windows 7 x64   
Issue Type: ENHANCEMENT Exception Reporter:

Description sc_dvp 2011-11-04 15:45:41 UTC
Hello,

It's juste a detail, but with this code example :

before formatting :
<div>
    <p>
        <hr />
    </p>
</div>

after formatting (Alt + Maj + F) :
<div>
    <p>
    <hr />
</p>
</div>

So, it would be better that lines before formatting not change after. However, with ' br ' tag, there is no problem.

Thanks.
Comment 1 Marek Fukala 2011-11-04 19:41:03 UTC
Thanks for filling the issue. It looks like the cause is the same as in the Bug 201125 - <tt> tag absorbs extra level of indentation in format source
Comment 2 sc_dvp 2011-11-06 08:26:43 UTC
The difference is that the <hr /> tag is an empty tag. But the result is indeed the same as the bug you 've say.
Comment 3 David Konecny 2012-04-24 02:11:18 UTC
Indenter follows document's DTD. In this case it looks to me that <hr/> closes <p> tag and therefore closing </p> is invalid. That's what IDE editor validation says as well - closing </p> is underlined and marked as "No p element in scope" error. This formats as expected:

        <div>
            <p>
            <hr/>
            <p>
            </p>
        </div>
Comment 4 sc_dvp 2012-05-18 21:33:52 UTC
Before html5, yes, you're right. In html5, it's ambiguous. But in absolute, it's effectively better to use <hr /> tag out of the <p> tag. So, it's not really an issue. Thanks for your work and good luck.