Skip to content

Commit

Permalink
fix: unexpected split the tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
XiangYyang committed Nov 10, 2023
1 parent 8d96856 commit 8aa25bf
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/kicanvas/elements/kicanvas-embed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,7 @@ class KiCanvasEmbedElement extends KCUIElement {
for (const child of src_elm.childNodes) {
if (child.nodeType === Node.TEXT_NODE) {
// Get the content and triming the CR,LF,space.
const child_text = child.nodeValue ?? "";
content += child_text.trimStart();
// Avoid unexpected token connections
content += " ";
content += child.nodeValue ?? "";
} else {
log.warn(
"kicanvas-source children type is not vaild and that be skiped.",
Expand All @@ -130,6 +127,8 @@ class KiCanvasEmbedElement extends KCUIElement {
}
}

content = content.trimStart();

// Determine the file extension name.
// That make `project.ts` determine the file type is possible.
let file_extname = "";
Expand Down

0 comments on commit 8aa25bf

Please sign in to comment.