← every case · 6000 · another language inside the file
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
| 1 | codecodecodecodecode | <p>before</p> |
| 2 | codecodecodecodecode | <script> |
| 3 | codecodecodecodecode | var s = "</script>"; |
| 4 | codecodecodecodecode | // not a comment: the script element ended on the line above |
| 5 | codecodecodecodecode | <p>after</p> |
stringcommentthe tag around another language
cloc --json cases/6000-another_language_inside_the_file/6060-script_closer_inside_a_string/input.html
mezura cases/6000-another_language_inside_the_file/6060-script_closer_inside_a_string/input.html --output json --hide timing --counting content
mezura cases/6000-another_language_inside_the_file/6060-script_closer_inside_a_string/input.html --output json --hide timing --counting region
scc --format json cases/6000-another_language_inside_the_file/6060-script_closer_inside_a_string/input.html
the closing line is counted once as markup and once as script, so the file is reported as one line longer than it is
tokei --output json cases/6000-another_language_inside_the_file/6060-script_closer_inside_a_string/input.html