Improve code block function

This commit is contained in:
2025-06-18 21:18:49 +08:00
parent cce9cf7e92
commit 9204315c7b
19 changed files with 1618 additions and 136 deletions

View File

@@ -0,0 +1,23 @@
@external tokens blockContent from "./external-tokens.js" {
BlockContent
}
@top Document { Block* }
Block {
BlockDelimiter BlockContent
}
BlockDelimiter {
"\n∞∞∞" BlockLanguage Auto? "\n"
}
BlockLanguage {
"text" | "math" | "json" | "python" | "html" | "sql" | "markdown" |
"java" | "php" | "css" | "xml" | "cpp" | "rust" | "ruby" | "shell" |
"yaml" | "go" | "javascript" | "typescript"
}
@tokens {
Auto { "-a" }
}