Skip to content

Commit

Permalink
fix get embedded css util (microsoft#120480)
Browse files Browse the repository at this point in the history
  • Loading branch information
aliasliao authored Apr 5, 2021
1 parent 65be3ac commit 80f1108
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions extensions/emmet/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -657,10 +657,8 @@ export function getEmbeddedCssNodeIfAny(document: vscode.TextDocument, currentNo
const currentHtmlNode = <HtmlFlatNode>currentNode;
if (currentHtmlNode && currentHtmlNode.open && currentHtmlNode.close) {
const offset = document.offsetAt(position);
if (currentHtmlNode.open.end <= offset && offset <= currentHtmlNode.close.start) {
if (currentHtmlNode.name === 'style'
&& currentHtmlNode.open.end < offset
&& currentHtmlNode.close.start > offset) {
if (currentHtmlNode.open.end < offset && offset <= currentHtmlNode.close.start) {
if (currentHtmlNode.name === 'style') {
const buffer = ' '.repeat(currentHtmlNode.open.end) + document.getText().substring(currentHtmlNode.open.end, currentHtmlNode.close.start);
return parseStylesheet(buffer);
}
Expand Down

0 comments on commit 80f1108

Please sign in to comment.