← every case · 6000 · another language inside the file
a script tag can name its language with a mime type instead of a lang attribute, and a mime type spells the language out: 'text/typescript', not 'text/ts'. The counts are the same whichever language answers, so what this case is about is the label
| 1 | codecodecodecodecode | <script type="text/typescript"> |
| 2 | comments TypeScriptcomments TypeScriptcomments TypeScriptcomments TypeScriptcomments TypeScript | // a comment inside the section |
| 3 | code TypeScriptcode TypeScriptcode TypeScriptcode TypeScriptcode TypeScript | interface Point { x: number } |
| 4 | codecodecodecodecode | </script> |
stringcommentthe tag around another language
the file is counted as one language from beginning to end, so a block named by a mime type is read with the page's symbols and the comment inside it lands in code
cloc --json cases/6000-another_language_inside_the_file/6080-block_named_by_a_mime_type/input.html
mezura cases/6000-another_language_inside_the_file/6080-block_named_by_a_mime_type/input.html --output json --hide timing --counting content
mezura cases/6000-another_language_inside_the_file/6080-block_named_by_a_mime_type/input.html --output json --hide timing --counting region
the block is not found, so the comment inside it counts as markup
scc --format json cases/6000-another_language_inside_the_file/6080-block_named_by_a_mime_type/input.html
the block is counted as JavaScript, although the mime type names TypeScript and their TypeScript is a language of its own
tokei --output json cases/6000-another_language_inside_the_file/6080-block_named_by_a_mime_type/input.html