luogu-renderer 1.0.1 → 1.0.4
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/luogu-new-renderer.iife.js +33874 -48877
- package/dist/luogu-old-renderer.iife.js +7461 -24386
- package/package.json +1 -1
- package/render-new.js +6 -8
package/package.json
CHANGED
package/render-new.js
CHANGED
|
@@ -12,13 +12,11 @@ import { visit } from 'unist-util-visit';
|
|
|
12
12
|
import { toText } from 'hast-util-to-text';
|
|
13
13
|
import katex from 'katex';
|
|
14
14
|
import { h } from 'hastscript';
|
|
15
|
-
import
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
require('prismjs/components/prism-c.js');
|
|
21
|
-
require('prismjs/components/prism-cpp.js');
|
|
15
|
+
import Prism from 'prismjs';
|
|
16
|
+
import 'prismjs/components/prism-clike.js';
|
|
17
|
+
import 'prismjs/components/prism-c.js';
|
|
18
|
+
import 'prismjs/components/prism-cpp.js';
|
|
19
|
+
globalThis.Prism = Prism;
|
|
22
20
|
|
|
23
21
|
// ========== 1. 表格合并(处理 ^ 符号,生成 rowspan)==========
|
|
24
22
|
// 在 rehype 阶段直接扫描表格,^ 向上合并并添加 rowspan
|
|
@@ -411,8 +409,8 @@ const processor = unified()
|
|
|
411
409
|
.use(remarkEpigraph) // epigraph 容器
|
|
412
410
|
.use(remarkCodeBlockParams) // 代码块参数
|
|
413
411
|
.use(remarkRehype, { allowDangerousHtml: true })
|
|
414
|
-
.use(rehypePrism)
|
|
415
412
|
.use(rehypeKatexWithError) // KaTeX 渲染,错误显示红色
|
|
413
|
+
.use(rehypePrism)
|
|
416
414
|
.use(rehypeCuteTableCleanup) // cute-table 包裹 table
|
|
417
415
|
.use(rehypeTableMerge) // 在 HTML 层面清理合并单元格
|
|
418
416
|
.use(rehypeAlignCleanup) // 对齐样式转移
|