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 242352 - [Reformat] Wrong indent of tags <a>, <li> encapsulated in <c:forEach>
Summary: [Reformat] Wrong indent of tags <a>, <li> encapsulated in <c:forEach>
Status: RESOLVED WONTFIX
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP (show other bugs)
Version: 8.0
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: David Konecny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-26 08:49 UTC by ssazonov
Modified: 2016-07-07 08:56 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
wrong indent of tags (40.09 KB, image/png)
2014-02-26 08:49 UTC, ssazonov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ssazonov 2014-02-26 08:49:43 UTC
Created attachment 145593 [details]
wrong indent of tags

1. Create JSP file:

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
    <head>
        <title>Roster</title>
    </head>
    <body>
        <h1>Roster</h1>
        <ul>
            <c:forEach var="member" items="${memberList}" 
                       varStatus="status">
                <li>
                    <a href="member.do?id=${status.index}">
                        <c:out value="${member}"></c:out>
                        </a>
                    </li>
            </c:forEach>
        </ul>
    </body>
</html>

2. Reformat it

>> Tags </a>, </li> have wrong indent (see attached image)

Product Version: NetBeans IDE 8.0 RC1 (Build 201402242200)
Java: 1.8.0; Java HotSpot(TM) 64-Bit Server VM 25.0-b67
Runtime: Java(TM) SE Runtime Environment 1.8.0-b126
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 1 PavelCibulka 2015-06-08 11:42:25 UTC
Problem seems to be connected to dynamic creation of HTML elements attributes.

Example:
<input type="checkbox" name="test" id="test" <c:if test="<%=true%>">checked</c:if>>
    <label for="test">
    <fmt:message  key="test"/>
</label>

<input type="checkbox" name="test" id="test" class="<c:if test="<%=true%>">hidden</c:if>">
    <label for="test">
    <fmt:message  key="test"/>
</label>


Note: It works fine with HTML only:
<input type="checkbox" name="test" id="test">
<label for="test">
    <fmt:message  key="test"/>
</label>

Still presents in 8.0.2
Comment 2 Martin Balin 2016-07-07 08:56:51 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss