diff --git a/compile.js b/compile.js index 54b07c7..27bbc91 100644 --- a/compile.js +++ b/compile.js @@ -39,7 +39,7 @@ if(Process.argv.length < 4 && require.main === module) { function markup(input, options) { let tableOfContents = new Remarkable().use(TOCGenerator.plugin(options)).render(input); - let output = new Remarkable().use(RemarkableHeaderIDs()).render("# Table of contents:\n"+tableOfContents.content+"\n"+input); + let output = new Remarkable().use(RemarkableHeaderIDs()).render("# Table of contents:\n"+tableOfContents.content+"\n\n"+input); return output; } @@ -73,6 +73,16 @@ function format(data, name) { .replace( /* fix tag attached to word and not whitespace */ /(\w+)(<[a-zA-Z]\w*>)/g, "$1 $2" + ) + .replace( /* replace .md links to html ones */ + /href="(.+)\.md"/g, + "href=\"$1.html\"" + ) + .replace( /* evil codeblock fix */ + /
((.|\n)*?)<\/code><\/pre>/g,
+ function(match, inline) {
+ return "" + inline.replace(/\t/g, "") + "
";
+ }
);
}
// probably should bring in a better templating engine but whatever
diff --git a/package-lock.json b/package-lock.json
index bf44556..656541d 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "yiki",
- "version": "0.1.1",
+ "version": "0.1.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "yiki",
- "version": "0.1.1",
+ "version": "0.1.2",
"license": "MIT",
"dependencies": {
"@liquify/prettify": "^0.5.5-beta.1",
diff --git a/package.json b/package.json
index e52507e..93292b7 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "yiki",
- "version": "0.1.1",
+ "version": "0.1.2",
"description": "The yellows111 wiki system",
"main": "compile.js",
"scripts": {