@@ -16,31 +16,31 @@ describe('Convert blocks', () => {
16
16
it ( 'should return the bold class' , ( ) => {
17
17
const bold = filterCssClasses ( { ...defaultAnnotations , bold : true } )
18
18
19
- expect ( bold ) . toEqual ( 'gs- bold' )
19
+ expect ( bold ) . toEqual ( 'data-notion-annotation=" bold" ' )
20
20
} )
21
21
22
22
it ( 'should return the italic class' , ( ) => {
23
23
const bold = filterCssClasses ( { ...defaultAnnotations , italic : true } )
24
24
25
- expect ( bold ) . toEqual ( 'gs- italic' )
25
+ expect ( bold ) . toEqual ( 'data-notion-annotation=" italic" ' )
26
26
} )
27
27
28
28
it ( 'should return the strikethrough class' , ( ) => {
29
29
const bold = filterCssClasses ( { ...defaultAnnotations , strikethrough : true } )
30
30
31
- expect ( bold ) . toEqual ( 'gs- strikethrough' )
31
+ expect ( bold ) . toEqual ( 'data-notion-annotation=" strikethrough" ' )
32
32
} )
33
33
34
34
it ( 'should return the underline class' , ( ) => {
35
35
const bold = filterCssClasses ( { ...defaultAnnotations , underline : true } )
36
36
37
- expect ( bold ) . toEqual ( 'gs- underline' )
37
+ expect ( bold ) . toEqual ( 'data-notion-annotation=" underline" ' )
38
38
} )
39
39
40
40
it ( 'should return the code class' , ( ) => {
41
41
const bold = filterCssClasses ( { ...defaultAnnotations , code : true } )
42
42
43
- expect ( bold ) . toEqual ( 'gs- code' )
43
+ expect ( bold ) . toEqual ( 'data-notion-annotation=" code" ' )
44
44
} )
45
45
46
46
it ( 'should not return any class if color is default' , ( ) => {
@@ -52,13 +52,13 @@ describe('Convert blocks', () => {
52
52
it ( 'should the color class' , ( ) => {
53
53
const bold = filterCssClasses ( { ...defaultAnnotations , color : 'brown' } )
54
54
55
- expect ( bold ) . toEqual ( 'gs- brown' )
55
+ expect ( bold ) . toEqual ( 'data-notion-color=" brown" ' )
56
56
} )
57
57
58
58
it ( 'should return bold and color class' , ( ) => {
59
59
const bold = filterCssClasses ( { ...defaultAnnotations , bold : true , color : 'orange' } )
60
60
61
- expect ( bold ) . toEqual ( 'gs- bold gs- orange' )
61
+ expect ( bold ) . toEqual ( 'data-notion-annotation=" bold" data-notion-color=" orange" ' )
62
62
} )
63
63
} )
64
64
@@ -76,39 +76,39 @@ describe('Convert blocks', () => {
76
76
77
77
const fn = convertBlockToHTML ( emptyParagraph , defaultPluginConfigRes )
78
78
79
- expect ( fn ) . toBe ( '<p><span class=gs-undefined ></span></p>' )
79
+ expect ( fn ) . toBe ( '<p><span></span></p>' )
80
80
} )
81
81
82
82
it ( 'should return a paragraph with text' , ( ) => {
83
83
const paragraph = [ MockParagraph ]
84
84
85
85
const fn = convertBlockToHTML ( paragraph , defaultPluginConfigRes )
86
86
87
- expect ( fn ) . toBe ( '<p><span class=gs-undefined >Lorem Ipsum Lorem Ipsum</span></p>' )
87
+ expect ( fn ) . toBe ( '<p><span>Lorem Ipsum Lorem Ipsum</span></p>' )
88
88
} )
89
89
90
90
it ( 'should return a heading level 2 when Notion sends a heading level 1' , ( ) => {
91
91
const headingOne = [ MockHeadingOne ]
92
92
93
93
const fn = convertBlockToHTML ( headingOne , defaultPluginConfigRes )
94
94
95
- expect ( fn ) . toBe ( '<h2><span class=gs-undefined >Heading one</span></h2>' )
95
+ expect ( fn ) . toBe ( '<h2><span>Heading one</span></h2>' )
96
96
} )
97
97
98
98
it ( 'should return a heading level 3 when Notion sends a heading level 2' , ( ) => {
99
99
const headingTwo = [ MockHeadingTwo ]
100
100
101
101
const fn = convertBlockToHTML ( headingTwo , defaultPluginConfigRes )
102
102
103
- expect ( fn ) . toBe ( '<h3><span class=gs-undefined >Heading two</span></h3>' )
103
+ expect ( fn ) . toBe ( '<h3><span>Heading two</span></h3>' )
104
104
} )
105
105
106
106
it ( 'should return a heading level 3 when Notion sends a heading level 2' , ( ) => {
107
107
const headingThree = [ MockHeadingThree ]
108
108
109
109
const fn = convertBlockToHTML ( headingThree , defaultPluginConfigRes )
110
110
111
- expect ( fn ) . toBe ( '<h4><span class=gs-undefined >Heading three</span></h4>' )
111
+ expect ( fn ) . toBe ( '<h4><span>Heading three</span></h4>' )
112
112
} )
113
113
114
114
it ( 'should return an unchecked todo item' , ( ) => {
@@ -117,7 +117,7 @@ describe('Convert blocks', () => {
117
117
const fn = convertBlockToHTML ( todoItemUnchecked , defaultPluginConfigRes )
118
118
119
119
expect ( fn ) . toBe (
120
- '<div class="gs- todo"><label for="657e68c6-1b09-478f-9912-c647e17077b8"><input type="checkbox" id="657e68c6-1b09-478f-9912-c647e17077b8" /> <span class=gs-undefined >Lorem Ipsum Lorem Ipsum</span></label></div>'
120
+ '<div data-notion=" todo"><label for="657e68c6-1b09-478f-9912-c647e17077b8"><input type="checkbox" id="657e68c6-1b09-478f-9912-c647e17077b8" /> <span>Lorem Ipsum Lorem Ipsum</span></label></div>'
121
121
)
122
122
} )
123
123
@@ -127,7 +127,7 @@ describe('Convert blocks', () => {
127
127
const fn = convertBlockToHTML ( todoItemChecked , defaultPluginConfigRes )
128
128
129
129
expect ( fn ) . toBe (
130
- '<div class="gs- todo"><label for="657e68c6-1b09-478f-9912-c647e17077b8"><input type="checkbox" id="657e68c6-1b09-478f-9912-c647e17077b8" checked /> <span class=gs-undefined >Lorem Ipsum Lorem Ipsum</span></label></div>'
130
+ '<div data-notion=" todo"><label for="657e68c6-1b09-478f-9912-c647e17077b8"><input type="checkbox" id="657e68c6-1b09-478f-9912-c647e17077b8" checked /> <span>Lorem Ipsum Lorem Ipsum</span></label></div>'
131
131
)
132
132
} )
133
133
@@ -137,7 +137,7 @@ describe('Convert blocks', () => {
137
137
const fn = convertBlockToHTML ( toggle , defaultPluginConfigRes )
138
138
139
139
expect ( fn ) . toBe (
140
- '<details class="gs- toggle"><summary><span class=gs-undefined >Lorem Ipsum Lorem Ipsum</span></summary>It\'s a toggle!</details>'
140
+ '<details data-notion=" toggle"><summary><span>Lorem Ipsum Lorem Ipsum</span></summary>It\'s a toggle!</details>'
141
141
)
142
142
} )
143
143
@@ -146,7 +146,7 @@ describe('Convert blocks', () => {
146
146
147
147
const fn = convertBlockToHTML ( childPage , defaultPluginConfigRes )
148
148
149
- expect ( fn ) . toBe ( '<p class="gs- child-page">This is a child page</p>' )
149
+ expect ( fn ) . toBe ( '<p data-notion=" child-page">This is a child page</p>' )
150
150
} )
151
151
152
152
it ( 'should return empty if block is not supported' , ( ) => {
0 commit comments