mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-09-02 19:52:40 +00:00
🐛 Fix: fix typeit shotrcode miss space when build with --minify param
This commit is contained in:
+3
-2
@@ -682,7 +682,7 @@ class FixIt {
|
||||
const singleLoop = typeitElement.dataset.loop;
|
||||
// get the content of the typed element
|
||||
stagingElement.innerHTML = '';
|
||||
stagingElement.appendChild(typeitElement.querySelector('template').content);
|
||||
stagingElement.appendChild(typeitElement.querySelector('template').content.cloneNode(true));
|
||||
// for shortcodes usage
|
||||
let targetEle = typeitElement.firstElementChild
|
||||
// for system elements usage
|
||||
@@ -690,9 +690,10 @@ class FixIt {
|
||||
typeitElement.innerHTML = '';
|
||||
targetEle = typeitElement
|
||||
}
|
||||
const typedContents = stagingElement.querySelector('pre')?.innerHTML || stagingElement.innerHTML
|
||||
// create a new instance of TypeIt for each element
|
||||
const instance = new TypeIt(targetEle, {
|
||||
strings: stagingElement.innerHTML,
|
||||
strings: typedContents,
|
||||
speed: speed,
|
||||
lifeLike: true,
|
||||
cursorSpeed: cursorSpeed,
|
||||
|
||||
@@ -36,6 +36,6 @@
|
||||
|
||||
<div {{ $wrapperAttrs | safeHTMLAttr }}>
|
||||
{{- printf `<%v %v></%v>` $tag $innerAttrs $tag | safeHTML -}}
|
||||
<template>{{ printf "%v" $content | safeHTML }}</template>
|
||||
<template><pre>{{ printf "%v" $content | safeHTML }}</pre></template>
|
||||
</div>
|
||||
{{- .Page.Store.Set "hasTyped" true -}}
|
||||
|
||||
Reference in New Issue
Block a user