Skip to content

Commit 99101f5

Browse files
committed
🔤 ⚡ converter - convert also comments
1 parent 2fcec05 commit 99101f5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

docs/components/converter.js.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function nodeToDDE(node, options = {}, level = 0) {
6767
const { nodeType } = node;
6868
// Handle text nodes
6969
if (nodeType === NODE_TYPE.TEXT) {
70-
const text = node.nodeValue;
70+
const text = el("i", { innerText: node.nodeValue }).textContent;
7171
if (!text.trim()) return null;
7272

7373
// Return as plain text or template string for longer text
@@ -78,7 +78,9 @@ function nodeToDDE(node, options = {}, level = 0) {
7878

7979
// Handle comment nodes
8080
if (nodeType === NODE_TYPE.COMMENT) {
81-
return null; // TODO: Skip comments?
81+
const text = node.nodeValue;
82+
if (!text.trim()) return null;
83+
return `// ${text}`;
8284
}
8385

8486
// For element nodes

0 commit comments

Comments
 (0)