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 234357 - HTML Tags Matching gets thrown off by PHP
Summary: HTML Tags Matching gets thrown off by PHP
Status: RESOLVED INVALID
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.4
Hardware: All All
: P3 normal (vote)
Assignee: Ondrej Brejla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-13 23:39 UTC by cwt137
Modified: 2013-08-14 07:04 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description cwt137 2013-08-13 23:39:48 UTC
Product Version = NetBeans IDE Dev (Build 2013-08-05_21-04-21)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.7.0_17
Runtime = Java HotSpot(TM) 64-Bit Server VM 23.7-b01

Here is a sample PHP file:

<!DOCTYPE html>
<html>
    <head>
        <title>Hello World!</title>
    </head>
    <body>
        <div id="wrap">
            <div class="container">
                <div class="row">
                    <?
                    foreach ($content_items as $i => $content) {

                        if ($i == 1) {
                            echo '<div class="foo">';
                        }

                        echo $content;
                        ?>                    
                        Hello World!!!
                        <?
                        if ($i == 1) {
                            echo '</div>';
                        }
                    }
                    ?>
                </div><!-- .row -->
            </div><!-- .container -->
        </div><!-- #wrap -->       
    </body>
</html>

TEST CASE 1:

Click on the closing end tag for the div with the "row" class.

Expected Results: The tag matching blue bracket on the left side of the editor should match with the opening div tag with the class "row"

Actual Results: The tag matching blue bracket on the left side of the editor matches with the opening div tag with the class "foo". This is wrong. It shouldn't even be looking at the PHP for a matching tag.

TEST CASE 2:

Click on the opening div tag with the "row" class.

Expected Results: The tag matching blue bracket on the left side of the editor should match it's corresponding closing div tag.

Actual Results: The tag matching blue bracket on the left side of the editor matches the "container" class closing div tag. This is one div tag off. I think it is taking into account the div tag inside PHP.
Comment 1 Ondrej Brejla 2013-08-14 07:04:28 UTC
You have disallowed usage of short open tags. Allow it in Project properties -> Sources -> Allow short open tags.

Or use long opent tags (<?php).

In your case whole file is parsed as html, so html matched div blocks in php part (which wasn't php part actually).