Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dda7eaeec1 |
@@ -223,7 +223,7 @@ export class ArticleRender implements MDRendererCallback {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 处理 gallery 短代码 -> wikilink 图片列表
|
// 处理 gallery 短代码 -> wikilink 图片列表
|
||||||
md = await transformGalleryShortcodes(md, this.settings.galleryPrePath, this.settings.galleryNumPic);
|
md = await transformGalleryShortcodes(md, this.settings.galleryPrePath, this.settings.galleryNumPic);
|
||||||
|
|
||||||
// 自定义行级语法转换: [fig .../] 以及 || 前缀块
|
// 自定义行级语法转换: [fig .../] 以及 || 前缀块
|
||||||
md = this.applyCustomInlineBlocks(md);
|
md = this.applyCustomInlineBlocks(md);
|
||||||
@@ -257,7 +257,7 @@ export class ArticleRender implements MDRendererCallback {
|
|||||||
}
|
}
|
||||||
// 自定义 fig 与 || 语法转换
|
// 自定义 fig 与 || 语法转换
|
||||||
private applyCustomInlineBlocks(md: string): string {
|
private applyCustomInlineBlocks(md: string): string {
|
||||||
const figPattern = /\[fig([^\n\]]*?)\/\]/g; // [fig text/]
|
const figPattern = /\[fig\s+([^\]]*?)\]/g; // [fig text]
|
||||||
md = md.replace(figPattern, (_m, inner) => {
|
md = md.replace(figPattern, (_m, inner) => {
|
||||||
const content = inner.trim();
|
const content = inner.trim();
|
||||||
return `<span style="font-style: italic; font-size: 14px; background-color: #f5f5f5; padding: 2px;">${content}</span>`;
|
return `<span style="font-style: italic; font-size: 14px; background-color: #f5f5f5; padding: 2px;">${content}</span>`;
|
||||||
|
|||||||
Reference in New Issue
Block a user