Skip to content

Commit

Permalink
fix(isInAttribute): with no attr
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon-He95 committed Aug 7, 2024
1 parent 64aaa03 commit 465cea1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -573,8 +573,8 @@ export function isInAttribute(child: any, position: any, offset: number) {
const startOffset = start.offset
const match = child.loc.source.slice(child.tag.length + 1).match('>')!
const endOffset = startOffset + match.index
const offset = getOffsetFromPosition(position)!
return (startOffset < offset) && (offset <= endOffset)
const _offset = getOffsetFromPosition(position)!
return (startOffset + offset < _offset) && (_offset <= endOffset + offset)
}
}
}
Expand Down

0 comments on commit 465cea1

Please sign in to comment.