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 254358

Summary: Source > Format incorrectly indents for JSTL <c:when> with nested <li> elements
Product: web Reporter: brettryan <brettryan>
Component: HTML EditorAssignee: Milutin Kristofic <mkristofic>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.0.2   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description brettryan 2015-08-14 07:42:12 UTC
Given the code

    <ol class="breadcrumb">
      <c:choose>
        <c:when test="${empty lineplan}">
          <li class="selected">Line Plans</li>
        </c:when>
        <c:otherwise>
          <li><a href="<c:url value="/product/lineplans"/>">Line Plans</a></li>
        </c:otherwise>
      </c:choose>
    </ol>

Invoking Source > format will result in:

    <ol class="breadcrumb">
      <c:choose>
        <c:when test="${empty lineplan}">
          <li class="selected">Line Plans</li>
          </c:when>
          <c:otherwise>
          <li><a href="<c:url value="/product/lineplans"/>">Line Plans</a></li>
          </c:otherwise>
        </c:choose>
    </ol>

Note this does not apply if the list elements are expanded as in the following:

    <ol class="breadcrumb">
      <c:choose>
        <c:when test="${empty lineplan}">
          <li class="selected">
            Line Plans
          </li>
        </c:when>
        <c:otherwise>
          <li>
            <a href="<c:url value="/product/lineplans"/>">Line Plans</a>
          </li>
        </c:otherwise>
      </c:choose>
    </ol>

Which formats correctly.

I have also tested with the 8.1 beta.
Comment 1 johannsig 2016-04-21 16:30:27 UTC
Would really like to see this addressed. I use Alt-Shift-F (Source>Format) ALL the time while writing JSPs and fixing indentations manually all the time tends to interrupt my work flow.