This commit is contained in:
Mayuran Visakan 2024-02-20 14:17:31 +00:00
parent 4284f88529
commit b86a8e7cff
4 changed files with 3 additions and 61 deletions

2
.todo
View file

@ -2,9 +2,9 @@ Features:
Other:
☐ YAML Frontmatter Highlighting
☐ https://raw.githubusercontent.com/deathau/cm-editor-syntax-highlight-obsidian/main/mode/yaml-frontmatter/yaml-frontmatter.js
☐ Embed other online markdown files?
Code Referencing:
☐ reference codeblock syntax highlighting
☐ Local reference
☐ Prevent clicking reading mode external links causing fold (@low)
☐ File watcher? (@low)

60
main.js

File diff suppressed because one or more lines are too long

View file

@ -24,7 +24,6 @@ export function createCodeblockCodeMirrorExtensions(settings: CodeStylerSettings
class ExamplePlugin implements PluginValue {
constructor() {
addReferenceSyntaxHighlight(window.CodeMirror);
addYamlFrontmatterSyntaxHighlighting(window.CodeMirror);
} // view: EditorView
update() {} // update: ViewUpdate
destroy() {}

View file

@ -78,6 +78,7 @@ export function addYamlFrontmatterSyntaxHighlighting(CodeMirror: typeof window.C
const START = 0, FRONTMATTER = 1, BODY = 2;
CodeMirror.defineMode("yaml-frontmatter", function(config, parserConfig) {
const yamlMode = CodeMirror.getMode(config, "yaml");
console.log(yamlMode);
const innerMode = CodeMirror.getMode(config, parserConfig?.base ?? "markdown");
function curMode(state) {