Comparing version 8.5.0 to 8.5.1
@@ -212,5 +212,8 @@ 'use strict' | ||
} else if (opts.word) { | ||
let stringRepresentation = this.source.input.document.slice( | ||
sourceOffset(this.source.input.document, this.source.start), | ||
sourceOffset(this.source.input.document, this.source.end) | ||
let inputString = ('document' in this.source.input) | ||
? this.source.input.document | ||
: this.source.input.css | ||
let stringRepresentation = inputString.slice( | ||
sourceOffset(inputString, this.source.start), | ||
sourceOffset(inputString, this.source.end) | ||
) | ||
@@ -226,7 +229,10 @@ let index = stringRepresentation.indexOf(opts.word) | ||
let line = this.source.start.line | ||
let offset = sourceOffset(this.source.input.document, this.source.start) | ||
let inputString = ('document' in this.source.input) | ||
? this.source.input.document | ||
: this.source.input.css | ||
let offset = sourceOffset(inputString, this.source.start) | ||
let end = offset + index | ||
for (let i = offset; i < end; i++) { | ||
if (this.source.input.document[i] === '\n') { | ||
if (inputString[i] === '\n') { | ||
column = 1 | ||
@@ -264,5 +270,8 @@ line += 1 | ||
if (opts.word) { | ||
let stringRepresentation = this.source.input.document.slice( | ||
sourceOffset(this.source.input.document, this.source.start), | ||
sourceOffset(this.source.input.document, this.source.end) | ||
let inputString = ('document' in this.source.input) | ||
? this.source.input.document | ||
: this.source.input.css | ||
let stringRepresentation = inputString.slice( | ||
sourceOffset(inputString, this.source.start), | ||
sourceOffset(inputString, this.source.end) | ||
) | ||
@@ -269,0 +278,0 @@ let index = stringRepresentation.indexOf(opts.word) |
@@ -10,3 +10,3 @@ 'use strict' | ||
constructor(plugins = []) { | ||
this.version = '8.5.0' | ||
this.version = '8.5.1' | ||
this.plugins = this.normalize(plugins) | ||
@@ -13,0 +13,0 @@ } |
{ | ||
"name": "postcss", | ||
"version": "8.5.0", | ||
"version": "8.5.1", | ||
"description": "Tool for transforming styles with JS plugins", | ||
@@ -5,0 +5,0 @@ "engines": { |
201829
6949