decap-cms-widget-markdown 3.3.0 → 3.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/decap-cms-widget-markdown.js +6 -6
  3. package/dist/decap-cms-widget-markdown.js.LICENSE.txt +5 -5
  4. package/dist/decap-cms-widget-markdown.js.map +1 -1
  5. package/dist/esm/MarkdownControl/RawEditor.js +1 -2
  6. package/dist/esm/MarkdownControl/Toolbar.js +43 -47
  7. package/dist/esm/MarkdownControl/VisualEditor.js +6 -8
  8. package/dist/esm/MarkdownControl/components/Shortcode.js +6 -11
  9. package/dist/esm/MarkdownControl/components/VoidBlock.js +1 -1
  10. package/dist/esm/MarkdownControl/index.js +34 -34
  11. package/dist/esm/MarkdownControl/plugins/CommandsAndQueries.js +8 -8
  12. package/dist/esm/MarkdownControl/plugins/inlines/events/toggleLink.js +1 -2
  13. package/dist/esm/MarkdownControl/plugins/lists/events/keyDownShiftTab.js +6 -9
  14. package/dist/esm/MarkdownControl/plugins/lists/events/keyDownTab.js +3 -7
  15. package/dist/esm/MarkdownControl/plugins/lists/transforms/liftFirstMatchedParent.js +4 -8
  16. package/dist/esm/MarkdownControl/plugins/lists/transforms/unwrapSelectionFromList.js +3 -7
  17. package/dist/esm/MarkdownControl/plugins/util.js +4 -4
  18. package/dist/esm/MarkdownControl/renderers.js +6 -11
  19. package/dist/esm/MarkdownPreview.js +11 -10
  20. package/dist/esm/index.js +4 -8
  21. package/dist/esm/regexHelper.js +4 -3
  22. package/dist/esm/serializers/index.js +2 -2
  23. package/dist/esm/serializers/remarkAssertParents.js +17 -20
  24. package/dist/esm/serializers/remarkEscapeMarkdownEntities.js +17 -17
  25. package/dist/esm/serializers/remarkImagesToText.js +3 -7
  26. package/dist/esm/serializers/remarkPaddedLinks.js +17 -21
  27. package/dist/esm/serializers/remarkRehypeShortcodes.js +10 -13
  28. package/dist/esm/serializers/remarkSlate.js +64 -55
  29. package/dist/esm/serializers/remarkSquashReferences.js +7 -11
  30. package/dist/esm/serializers/slateRemark.js +52 -52
  31. package/package.json +9 -7
  32. package/src/MarkdownControl/Toolbar.js +5 -0
  33. package/src/MarkdownControl/VisualEditor.js +1 -1
  34. package/src/MarkdownControl/components/Shortcode.js +1 -1
  35. package/src/MarkdownControl/index.js +5 -0
  36. package/src/MarkdownControl/plugins/CommandsAndQueries.js +3 -1
  37. package/src/MarkdownControl/plugins/util.js +2 -1
  38. package/src/MarkdownPreview.js +5 -0
  39. package/src/__tests__/renderer.spec.js +84 -117
  40. package/src/regexHelper.js +1 -1
  41. package/src/serializers/__tests__/commonmark.spec.js +1 -1
  42. package/src/serializers/__tests__/slate.spec.js +1 -1
  43. package/src/serializers/index.js +1 -1
  44. package/src/serializers/remarkAssertParents.js +4 -1
  45. package/src/serializers/remarkEscapeMarkdownEntities.js +4 -1
  46. package/src/serializers/remarkPaddedLinks.js +7 -1
  47. package/src/serializers/remarkRehypeShortcodes.js +2 -1
  48. package/src/serializers/remarkSlate.js +6 -1
  49. package/src/serializers/remarkSquashReferences.js +2 -1
  50. package/src/serializers/slateRemark.js +6 -1
  51. package/src/__tests__/__snapshots__/renderer.spec.js.snap +0 -239
@@ -1,239 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`Markdown Preview renderer HTML rendering should render HTML 1`] = `
4
- .emotion-0 {
5
- margin: 15px 2px;
6
- }
7
-
8
- <div
9
- className="emotion-0 emotion-1"
10
- dangerouslySetInnerHTML={
11
- Object {
12
- "__html": "<p>Paragraph with <em>inline</em> element</p>",
13
- }
14
- }
15
- />
16
- `;
17
-
18
- exports[`Markdown Preview renderer HTML sanitization should not sanitize HTML 1`] = `
19
- .emotion-0 {
20
- margin: 15px 2px;
21
- }
22
-
23
- <div
24
- className="emotion-0 emotion-1"
25
- dangerouslySetInnerHTML={
26
- Object {
27
- "__html": "<img src=\\"foobar.png\\" onerror=\\"alert('hello')\\">",
28
- }
29
- }
30
- />
31
- `;
32
-
33
- exports[`Markdown Preview renderer HTML sanitization should sanitize HTML 1`] = `
34
- .emotion-0 {
35
- margin: 15px 2px;
36
- }
37
-
38
- <div
39
- className="emotion-0 emotion-1"
40
- dangerouslySetInnerHTML={
41
- Object {
42
- "__html": "<img src=\\"foobar.png\\">",
43
- }
44
- }
45
- />
46
- `;
47
-
48
- exports[`Markdown Preview renderer Markdown rendering Code should render code 1`] = `
49
- .emotion-0 {
50
- margin: 15px 2px;
51
- }
52
-
53
- <div
54
- className="emotion-0 emotion-1"
55
- dangerouslySetInnerHTML={
56
- Object {
57
- "__html": "<p>Use the <code>printf()</code> function.</p>",
58
- }
59
- }
60
- />
61
- `;
62
-
63
- exports[`Markdown Preview renderer Markdown rendering Code should render code 2 1`] = `
64
- .emotion-0 {
65
- margin: 15px 2px;
66
- }
67
-
68
- <div
69
- className="emotion-0 emotion-1"
70
- dangerouslySetInnerHTML={
71
- Object {
72
- "__html": "<p><code>There is a literal backtick (\`) here.</code></p>",
73
- }
74
- }
75
- />
76
- `;
77
-
78
- exports[`Markdown Preview renderer Markdown rendering General should render markdown 1`] = `
79
- .emotion-0 {
80
- margin: 15px 2px;
81
- }
82
-
83
- <div
84
- className="emotion-0 emotion-1"
85
- dangerouslySetInnerHTML={
86
- Object {
87
- "__html": "<h1>H1</h1>
88
- <p>Text with <strong>bold</strong> &amp; <em>em</em> elements</p>
89
- <h2>H2</h2>
90
- <ul>
91
- <li>ul item 1</li>
92
- <li>ul item 2</li>
93
- </ul>
94
- <h3>H3</h3>
95
- <ol>
96
- <li>ol item 1</li>
97
- <li>ol item 2</li>
98
- <li>ol item 3</li>
99
- </ol>
100
- <h4>H4</h4>
101
- <p><a href=\\"http://google.com\\">link title</a></p>
102
- <h5>H5</h5>
103
- <p><img src=\\"https://pbs.twimg.com/profile_images/678903331176214528/TQTdqGwD.jpg\\" alt=\\"alt text\\" /></p>
104
- <h6>H6</h6>
105
- <p><img src=\\"https://pbs.twimg.com/profile_images/678903331176214528/TQTdqGwD.jpg\\" /></p>",
106
- }
107
- }
108
- />
109
- `;
110
-
111
- exports[`Markdown Preview renderer Markdown rendering HTML should render HTML as is when using Markdown 1`] = `
112
- .emotion-0 {
113
- margin: 15px 2px;
114
- }
115
-
116
- <div
117
- className="emotion-0 emotion-1"
118
- dangerouslySetInnerHTML={
119
- Object {
120
- "__html": "<h1>Title</h1>
121
- <form action=\\"test\\">
122
- <label for=\\"input\\">
123
- <input type=\\"checkbox\\" checked=\\"checked\\" id=\\"input\\"/> My label
124
- </label>
125
- <dl class=\\"test-class another-class\\" style=\\"width: 100%\\">
126
- <dt data-attr=\\"test\\">Test HTML content</dt>
127
- <dt>Testing HTML in Markdown</dt>
128
- </dl>
129
- </form>
130
- <h1 style=\\"display: block; border: 10px solid #f00; width: 100%\\">Test</h1>",
131
- }
132
- }
133
- />
134
- `;
135
-
136
- exports[`Markdown Preview renderer Markdown rendering Headings should render Heading 1 1`] = `
137
- .emotion-0 {
138
- margin: 15px 2px;
139
- }
140
-
141
- <div
142
- className="emotion-0 emotion-1"
143
- dangerouslySetInnerHTML={
144
- Object {
145
- "__html": "<h1>Title</h1>",
146
- }
147
- }
148
- />
149
- `;
150
-
151
- exports[`Markdown Preview renderer Markdown rendering Headings should render Heading 2 1`] = `
152
- .emotion-0 {
153
- margin: 15px 2px;
154
- }
155
-
156
- <div
157
- className="emotion-0 emotion-1"
158
- dangerouslySetInnerHTML={
159
- Object {
160
- "__html": "<h2>Title</h2>",
161
- }
162
- }
163
- />
164
- `;
165
-
166
- exports[`Markdown Preview renderer Markdown rendering Headings should render Heading 3 1`] = `
167
- .emotion-0 {
168
- margin: 15px 2px;
169
- }
170
-
171
- <div
172
- className="emotion-0 emotion-1"
173
- dangerouslySetInnerHTML={
174
- Object {
175
- "__html": "<h3>Title</h3>",
176
- }
177
- }
178
- />
179
- `;
180
-
181
- exports[`Markdown Preview renderer Markdown rendering Headings should render Heading 4 1`] = `
182
- .emotion-0 {
183
- margin: 15px 2px;
184
- }
185
-
186
- <div
187
- className="emotion-0 emotion-1"
188
- dangerouslySetInnerHTML={
189
- Object {
190
- "__html": "<h4>Title</h4>",
191
- }
192
- }
193
- />
194
- `;
195
-
196
- exports[`Markdown Preview renderer Markdown rendering Headings should render Heading 5 1`] = `
197
- .emotion-0 {
198
- margin: 15px 2px;
199
- }
200
-
201
- <div
202
- className="emotion-0 emotion-1"
203
- dangerouslySetInnerHTML={
204
- Object {
205
- "__html": "<h5>Title</h5>",
206
- }
207
- }
208
- />
209
- `;
210
-
211
- exports[`Markdown Preview renderer Markdown rendering Headings should render Heading 6 1`] = `
212
- .emotion-0 {
213
- margin: 15px 2px;
214
- }
215
-
216
- <div
217
- className="emotion-0 emotion-1"
218
- dangerouslySetInnerHTML={
219
- Object {
220
- "__html": "<h6>Title</h6>",
221
- }
222
- }
223
- />
224
- `;
225
-
226
- exports[`Markdown Preview renderer Markdown rendering Links should render links 1`] = `
227
- .emotion-0 {
228
- margin: 15px 2px;
229
- }
230
-
231
- <div
232
- className="emotion-0 emotion-1"
233
- dangerouslySetInnerHTML={
234
- Object {
235
- "__html": "<p>I get 10 times more traffic from <a href=\\"http://google.com/\\" title=\\"Google\\">Google</a> than from <a href=\\"http://search.yahoo.com/\\" title=\\"Yahoo Search\\">Yahoo</a> or <a href=\\"http://search.msn.com/\\" title=\\"MSN Search\\">MSN</a>.</p>",
236
- }
237
- }
238
- />
239
- `;