← every case · 6000 · another language inside the file

6060-script_closer_inside_a_string

a script element ends at the first closing tag whatever the JavaScript around it is doing, which is why one writes the closer with a backslash inside a string. So the block here holds no whole line, and everything under the closer is markup, including what looks like a comment

read ascloc.defaultmezura.contentmezura.regionscc.defaulttokei.default
input.html
1code<p>before</p>
2code<script>
3codevar s = "</script>";
4code// not a comment: the script element ended on the line above
5code<p>after</p>

stringcommentthe tag around another language

What each tool answered

cloc.default ✓ agrees
the rules ask5 lines · 0 blanks · 5 code · 0 comments
it answers5 lines · 0 blanks · 5 code · 0 comments

cloc --json cases/6000-another_language_inside_the_file/6060-script_closer_inside_a_string/input.html

mezura.content ✓ agrees
the rules ask5 lines · 5 code · 0 comments · 0 extra
it answers5 lines · 5 code · 0 comments · 0 extra

mezura cases/6000-another_language_inside_the_file/6060-script_closer_inside_a_string/input.html --output json --hide timing --counting content

mezura.region ✓ agrees
the rules ask5 lines · 0 blanks · 5 code · 0 comments
it answers5 lines · 0 blanks · 5 code · 0 comments

mezura cases/6000-another_language_inside_the_file/6060-script_closer_inside_a_string/input.html --output json --hide timing --counting region

scc.default ✓ agrees
the rules ask5 lines · 0 blanks · 5 code · 0 comments
it answers5 lines · 0 blanks · 5 code · 0 comments

scc --format json cases/6000-another_language_inside_the_file/6060-script_closer_inside_a_string/input.html

tokei.default ✗ fails

the closing line is counted once as markup and once as script, so the file is reported as one line longer than it is

the rules ask5 lines · 0 blanks · 5 code · 0 comments
it answers6 lines · 0 blanks · 6 code · 0 comments · JavaScript 1

tokei --output json cases/6000-another_language_inside_the_file/6060-script_closer_inside_a_string/input.html