Skip to content

Commit

Permalink
#286 Use correct SCE_HJA_TEMPLATELITERAL style for server-side template
Browse files Browse the repository at this point in the history
literals in HTML instead of client-side style.
  • Loading branch information
nyamatongwe committed Oct 22, 2024
1 parent cc50c7d commit ab42c6d
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 1 deletion.
13 changes: 13 additions & 0 deletions doc/LexillaHistory.html
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,19 @@ <h2>Contributors</h2>
</tr>
</table>
<h2>Releases</h2>
<h3>
<a href="https://www.scintilla.org/lexilla542.zip">Release 5.4.2</a>
</h3>
<ul>
<li>
Released 19 October 2024.
</li>
<li>
JavaScript: Use correct SCE_HJA_TEMPLATELITERAL style for server-side template literals in
HTML instead of client-side style.
<a href="https://github.com/ScintillaOrg/lexilla/issues/286">Issue #286</a>.
</li>
</ul>
<h3>
<a href="https://www.scintilla.org/lexilla541.zip">Release 5.4.1</a>
</h3>
Expand Down
2 changes: 1 addition & 1 deletion lexers/LexHTML.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ constexpr int statePrintForState(int state, script_mode inScriptType) noexcept {
StateToPrint = state + ((inScriptType == eNonHtmlScript) ? 0 : SCE_HA_PYTHON);
} else if ((state >= SCE_HB_START) && (state <= SCE_HB_STRINGEOL)) {
StateToPrint = state + ((inScriptType == eNonHtmlScript) ? 0 : SCE_HA_VBS);
} else if ((state >= SCE_HJ_START) && (state <= SCE_HJ_REGEX)) {
} else if ((state >= SCE_HJ_START) && (state <= SCE_HJ_TEMPLATELITERAL)) {
StateToPrint = state + ((inScriptType == eNonHtmlScript) ? 0 : SCE_HA_JS);
}
}
Expand Down
1 change: 1 addition & 0 deletions test/examples/hypertext/ServerJavaScript.aspx
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ Start
<%var x=3;//comment%>
<%x=3;//comment ?> %>
<%Response.Write(x)%>
<%Response.Write(`template ${2+2}`)%>
End
</html>
1 change: 1 addition & 0 deletions test/examples/hypertext/ServerJavaScript.aspx.folded
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
0 401 0 | <%var x=3;//comment%>
0 401 0 | <%x=3;//comment ?> %>
0 401 0 | <%Response.Write(x)%>
0 401 0 | <%Response.Write(`template ${2+2}`)%>
0 401 0 | End
0 401 0 | </html>
0 400 0
1 change: 1 addition & 0 deletions test/examples/hypertext/ServerJavaScript.aspx.styled
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ Start
{15}<%{62}var{56} {61}x{65}={60}3{65};{58}//comment{15}%>{0}
{15}<%{61}x{65}={60}3{65};{58}//comment ?> {15}%>{0}
{15}<%{61}Response.Write{65}({61}x{65}){15}%>{0}
{15}<%{61}Response.Write{65}({68}`template ${2+2}`{65}){15}%>{0}
End
{1}</html>{0}

0 comments on commit ab42c6d

Please sign in to comment.