Skip to content

Commit f44f6c6

Browse files
committed
Correct starting offset
1 parent 46584f5 commit f44f6c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const parse = (source: string): SFCDescriptor =>
1515
* Note that whitespace is preserved for debugging purposes
1616
*/
1717
export const removeStyleBlock = (source: string, styleDescriptor: SFCBlock): string => {
18-
const start = source.lastIndexOf('<', styleDescriptor.start + 1);
18+
const start = source.lastIndexOf('<', styleDescriptor.start - 1);
1919
const end = source.indexOf('>', styleDescriptor.end);
2020
const lines = source.slice(start, end).split('\n').length;
2121
return source.substring(0, start)

0 commit comments

Comments
 (0)