Treat style tag contents as css when commenting fixes #31685

This commit is contained in:
Ramya Achutha Rao
2017-07-31 17:27:21 -07:00
parent d53301df1b
commit f39385b832
3 changed files with 109 additions and 38 deletions

View File

@@ -77,7 +77,7 @@ function updateImageSizeStyleTag(editor: TextEditor, position: Position): Promis
if (currentNode && currentNode.name === 'style'
&& currentNode.open.end.isBefore(position)
&& currentNode.close.start.isAfter(position)) {
let buffer = new DocumentStreamReader(editor.document, currentNode.start, new Range(currentNode.start, currentNode.end));
let buffer = new DocumentStreamReader(editor.document, currentNode.open.end, new Range(currentNode.open.end, currentNode.close.start));
let rootNode = parseStylesheet(buffer);
const node = getNode(rootNode, position);
return (node && node.type === 'property') ? <Property>node : null;