Denoでscrapbox-parserを使う
Deno scrabox-parser
code:hello.ts
import { parse } from "https://deno.land/x/scrapbox_parser@0.0.1/src/index.ts";
console.log(parse("\nhelloa linkworld"));
code:output
$ deno run hello.ts
Check file:///Users/nishio/scaffold_network/hello.ts
[
{ type: "title", text: "" },
{
indent: 0,
type: "line",
nodes: [
{ type: "plain", raw: "hello", text: "hello" },
{ type: "link", raw: "a link", pathType: "relative", href: "a link", content: "" },
{ type: "plain", raw: "world", text: "world" }
]
}
]
/villagepump/2022/04/06#624d16c0aff09e00000d8e3d