This repository has been archived by the owner on Sep 27, 2023. It is now read-only.
[Bug] readme.txt parser fails if there are empty lines between headers #226
Labels
Type: Bug
There is a bug in the plugin.
Describe the bug
In case there is an empty line between headers in the readme.txt file, the parser parses correctly only headers before the empty line: other headers are incorrectly parsed as short description and the short description is not parsed at all.
To Reproduce
license
property is empty).readme.txt
file.Expected behavior
I'm not aware of guidelines preventing developers from adding line breaks between headers.
As such, I would expect that adding one or more empty lines between headers doesn't cause parsing errors.
Environment
Additional context
The following snippet shows that the parser has a few lines of code intended to allow line breaks between headers.
theme-sniffer/src/sniffs/readme/class-parser.php
Lines 233 to 238 in 1d6c852
The cause of this issue is that the
break
andcontinue
controls are switched: header parsing should continue if the line is empty and it should break if the line is not empty, but it is not a header either (i.e. if it doesn't contain a colon).The text was updated successfully, but these errors were encountered: