use express server

This commit is contained in:
patarapolw committed 2019-08-14 08:40:35 +07:00
1 parent 48cbaf1672
commit a10e7faa17
7 files changed
+835 -10

No files matched your search

+2 -1
View File
@@ -14,7 +14,7 @@ class Markdown {
const rowRegex = /(?:(?:^|\r?\n)(?:\| )?(?:(?:.* \| )+.+)*(?:.* \| )+.+(?: \|)?(?:$|\r?\n))+/m;
text = text.replace(rowRegex, (p0) => {
return h("table.table", p0.split("\n").map((pi) => {
return h("table.table", p0.trim().split("\n").map((pi) => {
pi = pi.trim().replace(/^|/, "").replace(/|$/, "")
return h("tr", pi.split(" | ").map((x) => x.trim()).map((qi) => {
@@ -36,6 +36,7 @@ class Markdown {
const md = new Markdown();
module.exports = {
Markdown,
apply() {
cogear.on("preload.page.parse", (page) => {
if (page.format === ".pug") {
+7
View File
@@ -0,0 +1,7 @@
const { Markdown } = require("./plugin");
const md = new Markdown();
console.log(md.md2html(`
a | b | c
d | e | f
`));