AlDanial / cloc

cloc counts blank lines, comment lines, and physical lines of source code in many programming languages.
GNU General Public License v2.0
19.75k stars 1.02k forks source link

Cloc doesn't support <![CDATA[ .... ]]]]><![CDATA[> ...]]> in XML #810

Closed PavelTurk closed 9 months ago

PavelTurk commented 9 months ago

Describe the bug Cloc doesn't support <![CDATA[ .... ]]]]><![CDATA[> ...]]> in XML . See https://stackoverflow.com/a/223782/5057736

cloc; OS; OS version

To Reproduce

<![CDATA[Certain tokens like ]]]]><![CDATA[> 
<!-- COMMENT -->
]]>
github.com/AlDanial/cloc v 1.99  T=0.01 s (114.0 files/s, 342.0 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
XML                              1              0              1              2
-------------------------------------------------------------------------------

Expected result 3 lines of code, 0 of comment

PavelTurk commented 9 months ago

It seems that cloc doesn't support CDATA

<![CDATA[
   <!-- COMMENT -->
]]>
github.com/AlDanial/cloc v 1.99  T=0.01 s (116.8 files/s, 350.4 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
XML                              1              0              1              2
-------------------------------------------------------------------------------
AlDanial commented 9 months ago

Unraveling CDATA might appear in a future release but for now I'm listing it as a limitation.