diff --git a/manifest.json b/manifest.json index 8b98c8b..2de21c2 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "hugo-publish", "name": "Hugo Publish", - "version": "1.0.8", + "version": "1.0.9", "minAppVersion": "0.15.0", "description": "Publish your blog to hugo site.", "author": "kirito", diff --git a/package.json b/package.json index 760b4ac..b3a0bb0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "obsidian-sample-plugin", - "version": "1.0.8", + "version": "1.0.9", "description": "This is a sample plugin for Obsidian (https://obsidian.md)", "main": "main.js", "scripts": { diff --git a/src/main.ts b/src/main.ts index d585c00..bf09751 100644 --- a/src/main.ts +++ b/src/main.ts @@ -175,6 +175,7 @@ export default class HugoPublishPlugin extends Plugin { //console.log("ast", ast) util.transform_wiki_image(ast); util.transform_wiki_link(ast); + util.transform_better_latex(ast); const meta = this.app.metadataCache.getFileCache(f); diff --git a/src/util.ts b/src/util.ts index 7e6102a..3f41ad6 100644 --- a/src/util.ts +++ b/src/util.ts @@ -100,6 +100,16 @@ export const get_md_yaml_hader_from_content = (content: string): [string, string } } +export const transform_better_latex = (ast: Root) => { + visit(ast, 'math', function (node, index, parent) { + // https://www.gohugo.org/doc/tutorials/mathjax_en/ + // just put LaTeX code in between