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 - error formatting on ' hr ' tag
Summary: error formatting on ' hr ' tag
Status: RESOLVED WORKSFORME
Alias: None
Product: web
Classification: Unclassified
Component: HTML Editor (show other bugs)
Version: 7.0.1
Hardware: PC Windows 7 x64
: P3 normal (vote)
Assignee: David Konecny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-04 15:45 UTC by sc_dvp
Modified: 2012-05-18 21:33 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.