Fixes #100 implements a custom Markdown renderer

This commit is contained in:
Zef Hemel
2022-11-01 15:01:28 +01:00
parent b8e27b216e
commit 3d671e8195
20 changed files with 652 additions and 37 deletions
+4 -4
View File
@@ -48,11 +48,11 @@ export function mdExtensionStyleTags({ nodeType, tag }: MDExt): {
}
export function loadMarkdownExtensions(system: System<any>): MDExt[] {
let mdExtensions: MDExt[] = [];
for (let plug of system.loadedPlugs.values()) {
let manifest = plug.manifest as Manifest;
const mdExtensions: MDExt[] = [];
for (const plug of system.loadedPlugs.values()) {
const manifest = plug.manifest as Manifest;
if (manifest.syntax) {
for (let [nodeType, def] of Object.entries(manifest.syntax)) {
for (const [nodeType, def] of Object.entries(manifest.syntax)) {
mdExtensions.push({
nodeType,
tag: Tag.define(),
+2 -4
View File
@@ -1,7 +1,5 @@
import { ParseTree } from "$sb/lib/tree.ts";
import type { SyntaxNode } from "./deps.ts";
import type { Language } from "./deps.ts";
import type { ParseTree } from "$sb/lib/tree.ts";
import type { Language, SyntaxNode } from "./deps.ts";
export function lezerToParseTree(
text: string,