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.
In templating languages it is common to generate attribute values like this: <body align=<%="center"%> valign="top"/> However html lexer just sees <body align= valign="top"/> and stops lexing after the first equals sign. Better would be to reset to "in tag" state and then use some semantic error to indicate the missing value.
Another example from issue #162841 is: <div <%="..."%> />. The resulting html virtual source is <div @@@/> which the html lexer doesn't accept hence the parse tree is broken (and the users are unhappy about false warnings in the source).
Another example from issue #162841 is: <div <%="..."%> />. The resulting html virtual source is <div @@@/> which the html lexer doesn't accept hence the parse tree is broken (and the users are unhappy about false warnings in the source). I'll try to fix this into nb6.7
*** Issue 162492 has been marked as a duplicate of this issue. ***
*** Issue 167860 has been marked as a duplicate of this issue. ***
fixed in web-main#4c1659cc0926
Integrated into 'main-golden', will be available in build *200911030222* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/4c1659cc0926 User: Marek Fukala <mfukala@netbeans.org> Log: #149968 - better lexing error recovery
I have got NB6.7.1 build:200911211148, but there still seems to be a problem with sentences like this: <input type="radio" name="mode" value="all" <?= ($_SESSION['mode']==='all') ? 'checked' :'' ?> /> I get the error: "Missing required end tag". If I write: <input type="radio" name="mode" value="all" checked="<?= ($_SESSION['mode']==='all') ? 'checked' :'' ?>" /> instead, then no error is reported, but then ofcourse I loose the functionality which was the reason for putting the php-bit in there. *to sum up: <emptytag <?= ?> /> reports "missing end tag" error but shouldn't <emptytag att="<?= ?>" /> does not report error, which is ok
I'm aware of the <emptytag att="<?= ?>" issue. It is supposed to be filed as an issue somwhere, but I cannot find it now. There's a unit test for this usecase as well. in CssParserTest. I'll duplicate it once I find the original issue. Thanks for your time.
I've tried following cases (in s JSP) in latest dev build: OK: <div align="<%="center"%>" class="Bordered"/> <input type="radio" name="mode" value="all" <%= "" %> /> Fails (the text after templating is lexed as attribute value): <div align=<%="center"%> valign="top"/>
The case <div align=<%="center"%> valign="top"/> is little harder to fix since the html lexer sees just the html code, not the templating: <div align= valign="top"/>
There needs to be some kind of possibility to check if the char read from the lexer input directly preceedes the previous char or if there's a gap. I could imagine a new method: boolean LexerInput.readCharAfterGap(); which the lexer could use to optimize the behaviour in the kind of situations described above.
Milo, possibly close as won't fix if it is not doable or too much work. Thanks.
Closing some old Mila's bugs.