tiptap-extension-shiki 1.0.4 → 1.0.5
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.
- package/dist/index.cjs.js +2 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +5 -0
package/dist/index.cjs.js
CHANGED
|
@@ -314,6 +314,8 @@ const TiptapShiki = CodeBlock.extend({
|
|
|
314
314
|
container.innerHTML = highlightedCode;
|
|
315
315
|
if (container.firstElementChild) {
|
|
316
316
|
const rsDOM = container.firstElementChild;
|
|
317
|
+
if (this.options.extraRenderPrependDOM)
|
|
318
|
+
rsDOM.prepend(this.options.extraRenderPrependDOM);
|
|
317
319
|
Object.keys(HTMLAttributes).forEach((key) => {
|
|
318
320
|
rsDOM.setAttribute(key, HTMLAttributes[key]);
|
|
319
321
|
});
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -310,6 +310,8 @@ const TiptapShiki = CodeBlock.extend({
|
|
|
310
310
|
container.innerHTML = highlightedCode;
|
|
311
311
|
if (container.firstElementChild) {
|
|
312
312
|
const rsDOM = container.firstElementChild;
|
|
313
|
+
if (this.options.extraRenderPrependDOM)
|
|
314
|
+
rsDOM.prepend(this.options.extraRenderPrependDOM);
|
|
313
315
|
Object.keys(HTMLAttributes).forEach((key) => {
|
|
314
316
|
rsDOM.setAttribute(key, HTMLAttributes[key]);
|
|
315
317
|
});
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -53,6 +53,7 @@ const TiptapShiki = CodeBlock.extend<
|
|
|
53
53
|
styles?: Record<string, string>;
|
|
54
54
|
attrs?: Record<string, string>;
|
|
55
55
|
};
|
|
56
|
+
extraRenderPrependDOM?: HTMLElement;
|
|
56
57
|
// 显示行号
|
|
57
58
|
showLineNumbers?: boolean;
|
|
58
59
|
// 自定义工具栏渲染函数
|
|
@@ -188,6 +189,10 @@ const TiptapShiki = CodeBlock.extend<
|
|
|
188
189
|
container.innerHTML = highlightedCode;
|
|
189
190
|
if (container.firstElementChild) {
|
|
190
191
|
const rsDOM = container.firstElementChild as HTMLElement;
|
|
192
|
+
|
|
193
|
+
if (this.options.extraRenderPrependDOM)
|
|
194
|
+
rsDOM.prepend(this.options.extraRenderPrependDOM);
|
|
195
|
+
|
|
191
196
|
Object.keys(HTMLAttributes).forEach((key) => {
|
|
192
197
|
rsDOM.setAttribute(key, HTMLAttributes[key]);
|
|
193
198
|
});
|