Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Slightly more intention revealing line cleaning

  • Loading branch information...
commit 1a916271cccffd3ab4815094fb3ec090d9b6e574 1 parent df14bfe
@technicalpickles technicalpickles authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/robot.coffee
View
5 src/robot.coffee
@@ -260,8 +260,8 @@ class Robot
for line in body.split "\n"
break unless line[0] is '#' or line.substr(0, 2) is '//'
- # remove leading '# '
- cleanedLine = line[2..line.length].replace("\n", "").trim()
+ # remove leading comment
+ cleanedLine = line.replace(/^(#|\/\/)\s?/, "").trim()
@logger.debug "parseHelp(#{scriptName}): read #{cleanedLine}"
continue if cleanedLine.length is 0
@@ -279,6 +279,7 @@ class Robot
scriptDocumentation[currentSection].push cleanedLine.trim()
if currentSection == 'commands'
@commands.push cleanedLine.trim()
+
# no current section? probably using old style documentation
if currentSection is null
@logger.info "#{path} is using deprecated documentation syntax"
Please sign in to comment.
Something went wrong with that request. Please try again.