mdmath icon indicating copy to clipboard operation
mdmath copied to clipboard

HTML title in md

Open MattPChoy opened this issue 2 years ago • 1 comments

Is there a way to encode the HTML page's title in the markdown source file?

MattPChoy avatar Apr 29 '23 05:04 MattPChoy

I think the following code may works with metadata at the beginning like this: {{{"title":"YOUR TITLE"}}} or ---"title":"YOUR TITLE"---

https://github.com/goessner/mdmath/blob/b562f83cf1f427ea74f80dd90b62e3eeec2cad2c/extension.js#L75-L94

But unfortunately, this code does not clear the metadata from the output. I guess it should be like this at line 79:

markdown = markdown.replace(/^\s*?[{\-]{3}([\s\S]+?)[}\-.]{3}\s*?/g, ($0,$1) => { frontmatter = $1; return '';});

JimLyu avatar Oct 24 '24 03:10 JimLyu