Page 1 of 1

Make changelog.txt parser more user friendly

Posted: Thu Dec 28, 2017 9:42 am
by Optera
The parser feels way to nitpicky about indents and correct amount of whitespaces. Often it complains with "missing colon after category." when the actual fix is to add and remove indent in Npp.

Parsing changelogs like this would be a lot more forgiving to randomly placed whitespaces and also allow indenting with tabs.

Code: Select all

foreach line in file {
  strg = trim(line).toLower();  
  if strg.StartsWith("version:") {
    // version
  } else if strg.StartsWith("date:") {
    // date    
  } else if strg.EndsWith(":") {
    // category    
  } else if strg.StartsWith("----") {
    // separator
  } else if strg.StartsWith("-") {
    // add list item to last read category
  }
}