Print selector-string (#1759)

master
Christopher Chedeau 2017-05-26 15:54:39 -07:00 committed by GitHub
parent 4b727daa54
commit 2a33309e3d
5 changed files with 18 additions and 2 deletions

View File

@ -322,8 +322,8 @@ function parseNestedCSS(node) {
try {
node.value = parseValue(node.value);
} catch (e) {
const line = +e.toString().match(/line: ([0-9]+)/)[1];
const column = +e.toString().match(/column ([0-9]+)/)[1];
const line = +(e.toString().match(/line: ([0-9]+)/) || [1, 1])[1];
const column = +(e.toString().match(/column ([0-9]+)/) || [0, 0])[1];
throw createError(
e.toString(),
node.source.start.line + line - 1,

View File

@ -2576,6 +2576,9 @@ function genericPrintNoParens(path, options, print, args) {
case "selector-comment": {
return n.value;
}
case "selector-string": {
return n.value;
}
case "selector-tag": {
return n.value;
}

View File

@ -0,0 +1,10 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`string.css 1`] = `
:not(".public/basics/positioning") {
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:not(".public/basics/positioning") {
}
`;

View File

@ -0,0 +1 @@
run_spec(__dirname, { parser: "postcss" });

View File

@ -0,0 +1,2 @@
:not(".public/basics/positioning") {
}