← every case · 6000 · another language inside the file

6020-comment_opener_inside_an_attribute

a comment opener written inside a quoted attribute value, where HTML reads it as text. Nothing closes it further down, so a counter that opened a comment there never ends one

read ascloc.defaultmezura.contentmezura.regionscc.defaulttokei.default
input.html
1code<div title="<!-- this is text in an attribute">
2code<p>first</p>
3code<p>second</p>

stringcommentthe tag around another language

What each tool answered

cloc.default ✗ fails

a comment opener inside a quoted attribute value opens a comment all the same, and nothing below closes it, so both lines under it count as comments

the rules ask3 lines · 0 blanks · 3 code · 0 comments
it answers3 lines · 0 blanks · 1 code · 2 comments

cloc --json cases/6000-another_language_inside_the_file/6020-comment_opener_inside_an_attribute/input.html

mezura.content ✗ fails

HTML declares no string symbols, on purpose, because its quotes hold attributes and its text is full of apostrophes. The price is this one: a quoted opener cannot be seen

the rules ask3 lines · 3 code · 0 comments · 0 extra
it answers3 lines · 1 code · 2 comments · 0 extra

mezura cases/6000-another_language_inside_the_file/6020-comment_opener_inside_an_attribute/input.html --output json --hide timing --counting content

mezura.region ✗ fails

HTML declares no string symbols, on purpose, because its quotes hold attributes and its text is full of apostrophes. The price is this one: a quoted opener cannot be seen

the rules ask3 lines · 0 blanks · 3 code · 0 comments
it answers3 lines · 0 blanks · 1 code · 2 comments

mezura cases/6000-another_language_inside_the_file/6020-comment_opener_inside_an_attribute/input.html --output json --hide timing --counting region

scc.default ✓ agrees
the rules ask3 lines · 0 blanks · 3 code · 0 comments
it answers3 lines · 0 blanks · 3 code · 0 comments

scc --format json cases/6000-another_language_inside_the_file/6020-comment_opener_inside_an_attribute/input.html

tokei.default ✓ agrees
the rules ask3 lines · 0 blanks · 3 code · 0 comments
it answers3 lines · 0 blanks · 3 code · 0 comments

tokei --output json cases/6000-another_language_inside_the_file/6020-comment_opener_inside_an_attribute/input.html