File tree Expand file tree Collapse file tree 9 files changed +25
-2
lines changed Expand file tree Collapse file tree 9 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,12 @@ Value: `'quoted'`
16
16
### ` value `
17
17
Type: ` String ` <br >
18
18
19
- The value of the string between the quote characters.
19
+ The value of the string between the quote characters, * including* quotes.
20
+
21
+ ### ` contents `
22
+ Type: ` String ` <br >
23
+
24
+ The value of the string between the quote characters, * without* quotes.
20
25
21
26
## Example Values
22
27
Original file line number Diff line number Diff line change @@ -185,6 +185,7 @@ export interface Quoted extends NodeBase {
185
185
parent : Container ;
186
186
quote : string ;
187
187
value : string ;
188
+ contents : string ;
188
189
}
189
190
190
191
export interface UnicodeRange extends NodeBase {
Original file line number Diff line number Diff line change 8
8
The above copyright notice and this permission notice shall be
9
9
included in all copies or substantial portions of this Source Code Form.
10
10
*/
11
+ const { unquote } = require ( 'quote-unquote' ) ;
12
+
11
13
const { registerWalker } = require ( '../walker' ) ;
12
14
13
15
const Node = require ( './Node' ) ;
@@ -16,6 +18,7 @@ class Quoted extends Node {
16
18
constructor ( options ) {
17
19
super ( options ) ;
18
20
this . type = 'quoted' ;
21
+ this . contents = unquote ( options . value ) ;
19
22
[ this . quote ] = options . value ;
20
23
}
21
24
Original file line number Diff line number Diff line change 32
32
"dependencies" : {
33
33
"color-name" : " ^1.1.4" ,
34
34
"is-url-superb" : " ^4.0.0" ,
35
- "postcss" : " ^7.0.5"
35
+ "postcss" : " ^7.0.5" ,
36
+ "quote-unquote" : " ^1.0.0"
36
37
},
37
38
"devDependencies" : {
38
39
"ava" : " ^3.5.1" ,
Original file line number Diff line number Diff line change @@ -2677,6 +2677,7 @@ Generated by [AVA](https://avajs.dev).
2677
2677
name: 'url',
2678
2678
nodes: [
2679
2679
Quoted {
2680
+ contents: '/gfx/img/bg.jpg',
2680
2681
parent: [Circular],
2681
2682
quote: '"',
2682
2683
raws: {
@@ -2746,6 +2747,7 @@ Generated by [AVA](https://avajs.dev).
2746
2747
name: 'url',
2747
2748
nodes: [
2748
2749
Quoted {
2750
+ contents: 'http://domain.com/gfx/img/bg.jpg',
2749
2751
parent: [Circular],
2750
2752
quote: '"',
2751
2753
raws: {
@@ -2815,6 +2817,7 @@ Generated by [AVA](https://avajs.dev).
2815
2817
name: 'url',
2816
2818
nodes: [
2817
2819
Quoted {
2820
+ contents: '/gfx/img/bg.jpg',
2818
2821
parent: [Circular],
2819
2822
quote: '\'',
2820
2823
raws: {
@@ -2884,6 +2887,7 @@ Generated by [AVA](https://avajs.dev).
2884
2887
name: 'url',
2885
2888
nodes: [
2886
2889
Quoted {
2890
+ contents: 'http://domain.com/gfx/img/bg.jpg',
2887
2891
parent: [Circular],
2888
2892
quote: '\'',
2889
2893
raws: {
@@ -3153,6 +3157,7 @@ Generated by [AVA](https://avajs.dev).
3153
3157
name: 'url',
3154
3158
nodes: [
3155
3159
Quoted {
3160
+ contents: '/gfx/img/bg.jpg',
3156
3161
parent: [Circular],
3157
3162
quote: '"',
3158
3163
raws: {
@@ -3250,6 +3255,7 @@ Generated by [AVA](https://avajs.dev).
3250
3255
name: 'url',
3251
3256
nodes: [
3252
3257
Quoted {
3258
+ contents: 'http://domain.com/gfx/img/bg.jpg',
3253
3259
parent: [Circular],
3254
3260
quote: '"',
3255
3261
raws: {
Original file line number Diff line number Diff line change @@ -953,6 +953,7 @@ Generated by [AVA](https://avajs.dev).
953
953
value: '3',
954
954
},
955
955
Quoted {
956
+ contents: 'Open Sans',
956
957
quote: '\'',
957
958
raws: {
958
959
after: '',
@@ -1050,6 +1051,7 @@ Generated by [AVA](https://avajs.dev).
1050
1051
value: ',',
1051
1052
},
1052
1053
Quoted {
1054
+ contents: 'Helvetica Neue',
1053
1055
quote: '"',
1054
1056
raws: {
1055
1057
after: '',
You can’t perform that action at this time.
0 commit comments