Lex contents of <script> tags as plain text.

When lexing input in HTML mode the lexer has to treat _all_ content of a
<script> tag as plain text. This ensures that the lexer can process input such
as "x <y" and "// <foo>" correctly.

Fixes #70.
This commit is contained in:
Yorick Peterse committed 2015-03-02 16:22:09 +01:00
1 parent 351b5ac004
commit ba2177e2cf
4 files changed
+73 -2

No files matched your search

+11
View File
@@ -185,6 +185,17 @@ public class Lexer extends RubyObject
this.callMethod(context, "advance_line", lines);
}
/**
* Returns true if we're in an HTML script tag. See
* Oga::XML::Lexer#inside_html_script? for more information.
*/
public Boolean inside_html_script_p()
{
ThreadContext context = this.runtime.getCurrentContext();
return this.callMethod(context, "inside_html_script?").isTrue();
}
}
%%{