Ignore script tags in HTML files which are not JavaScript.
This commit is contained in:
parent
dbe76a5145
commit
42e5ec14e6
|
@ -87,7 +87,9 @@ public class DomLessSourceExtractor extends JSSourceExtractor {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleEndTag(ITag tag) {
|
public void handleEndTag(ITag tag) {
|
||||||
if (tag.getName().equalsIgnoreCase("script")) {
|
if (tag.getName().equalsIgnoreCase("script")
|
||||||
|
&& (tag.getAttributeByName("type") == null
|
||||||
|
|| tag.getAttributeByName("type").fst.equals("text/javascript"))) {
|
||||||
assert currentScriptTag != null;
|
assert currentScriptTag != null;
|
||||||
currentScriptTag = null;
|
currentScriptTag = null;
|
||||||
} else if (currentScriptTag != null && tag.getName().equals("!--")) {
|
} else if (currentScriptTag != null && tag.getName().equals("!--")) {
|
||||||
|
@ -118,7 +120,9 @@ public class DomLessSourceExtractor extends JSSourceExtractor {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleStartTag(ITag tag) {
|
public void handleStartTag(ITag tag) {
|
||||||
if (tag.getName().equalsIgnoreCase("script")) {
|
if (tag.getName().equalsIgnoreCase("script")
|
||||||
|
&& (tag.getAttributeByName("type") == null
|
||||||
|
|| tag.getAttributeByName("type").fst.equals("text/javascript"))) {
|
||||||
handleScript(tag);
|
handleScript(tag);
|
||||||
assert currentScriptTag == null;
|
assert currentScriptTag == null;
|
||||||
currentScriptTag = tag;
|
currentScriptTag = tag;
|
||||||
|
|
Loading…
Reference in New Issue