Make it modern
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "markdown",
|
||||
"version": "0.0.1",
|
||||
"version": "0.1.0",
|
||||
"description": "",
|
||||
"author": "Fabian Stamm <dev@fabianstamm.de>",
|
||||
"contributors": [],
|
||||
@ -9,4 +9,4 @@
|
||||
"**/*.js",
|
||||
"README.md"
|
||||
]
|
||||
}
|
||||
}
|
@ -22,7 +22,9 @@ import {
|
||||
Obj
|
||||
} from "./interfaces.ts";
|
||||
import { Marked } from "./marked.ts";
|
||||
import { load } from "https://deno.land/std/encoding/_yaml/loader/loader.ts";
|
||||
import { parse } from "https://deno.land/std@0.208.0/yaml/mod.ts";
|
||||
|
||||
|
||||
|
||||
export class BlockLexer<T extends typeof BlockLexer> {
|
||||
static simpleRules: RegExp[] = [];
|
||||
@ -300,7 +302,7 @@ export class BlockLexer<T extends typeof BlockLexer> {
|
||||
// Grabs front-matter data and parse it into Javascript object.
|
||||
if (fmArr = /^(?:\-\-\-)(.*?)(?:\-\-\-|\.\.\.)/s.exec(nextPart)) {
|
||||
nextPart = nextPart.substring(fmArr[0].length);
|
||||
this.frontmatter = <Obj> load(fmArr[1]);
|
||||
this.frontmatter = <Obj>parse(fmArr[1]);
|
||||
}
|
||||
continue;
|
||||
|
||||
@ -510,7 +512,7 @@ export class BlockLexer<T extends typeof BlockLexer> {
|
||||
if (nextPart) {
|
||||
throw new Error(
|
||||
"Infinite loop on byte: " + nextPart.charCodeAt(0) +
|
||||
`, near text '${nextPart.slice(0, 30)}...'`,
|
||||
`, near text '${nextPart.slice(0, 30)}...'`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user