We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 26d059f commit 6538230Copy full SHA for 6538230
lib/parser.js
@@ -169,13 +169,17 @@ export const parseSvg = (data, from) => {
169
value: text,
170
};
171
pushToContent(node);
172
- } else if (/\S/.test(text)) {
173
- /** @type {import('./types.js').XastText} */
174
- const node = {
175
- type: 'text',
176
- value: text.trim(),
177
- };
178
- pushToContent(node);
+ } else {
+ const value = text.trim();
+
+ if (value !== '') {
+ /** @type {import('./types.js').XastText} */
+ const node = {
+ type: 'text',
179
+ value,
180
+ };
181
+ pushToContent(node);
182
+ }
183
}
184
185
0 commit comments