Comparing version 1.0.4 to 1.0.5
{ | ||
"name": "svglint", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Linter for SVGs", | ||
@@ -5,0 +5,0 @@ "main": "src/svglint.js", |
@@ -93,3 +93,3 @@ /** | ||
// @ts-ignore | ||
return Parser.parseDOM(source, { | ||
const outp = Parser.parseDOM(source, { | ||
withStartIndices: true, | ||
@@ -99,2 +99,3 @@ withEndIndices: true, | ||
}); | ||
return outp; | ||
} | ||
@@ -121,3 +122,3 @@ | ||
let columnNum = lineStart; | ||
while ((columnNum = source.lastIndexOf("\n", columnNum - 1)) !== -1) { | ||
while ((columnNum = source.lastIndexOf("\n", columnNum - 1)) !== -1 && columnNum > 0) { | ||
++numLines; | ||
@@ -124,0 +125,0 @@ } |
@@ -28,2 +28,10 @@ const expect = require("expect"); | ||
it("should succeed with empty first line", function(done) { | ||
const result = SVGLint.lintSource("\n" + svg, {}); | ||
result.on("done", () => { | ||
expect(result.state).toBe(result.STATES.success); | ||
done(); | ||
}); | ||
}); | ||
it("should throw with malformed SVG", function() { | ||
@@ -30,0 +38,0 @@ expect(() => { |
115467
39
2385