diff --git a/build-docs.js b/build-docs.js
index 335078c8..4d3c8518 100644
--- a/build-docs.js
+++ b/build-docs.js
@@ -1,6 +1,7 @@
import { promises } from 'fs';
import { join, dirname, parse, format } from 'path';
-import { parse as marked } from './lib/marked.esm.js';
+import { Marked } from './lib/marked.esm.js';
+import { markedHighlight } from 'marked-highlight';
import { HighlightJS } from 'highlight.js';
import titleize from 'titleize';
@@ -12,6 +13,12 @@ const outputDir = join(cwd, 'public');
const templateFile = join(inputDir, '_document.html');
const isUppercase = str => /[A-Z_]+/.test(str);
const getTitle = str => str === 'INDEX' ? '' : titleize(str.replace(/_/g, ' ')) + ' - ';
+const marked = new Marked(markedHighlight((code, language) => {
+ if (!language) {
+ return highlightAuto(code).value;
+ }
+ return highlight(code, { language }).value;
+}));
async function init() {
console.log('Cleaning up output directory ' + outputDir);
@@ -38,14 +45,7 @@ async function build(currentDir, tmpl) {
let buffer = await readFile(filename);
const parsed = parse(filename);
if (parsed.ext === '.md' && isUppercase(parsed.name)) {
- const html = marked(buffer.toString('utf8'), {
- highlight: (code, language) => {
- if (!language) {
- return highlightAuto(code).value;
- }
- return highlight(code, { language }).value;
- }
- });
+ const html = marked.parse(buffer.toString('utf8'));
buffer = Buffer.from(tmpl
.replace('', getTitle(parsed.name))
.replace('', html),
diff --git a/docs/AUTHORS.md b/docs/AUTHORS.md
index 71289005..5d4630b9 100644
--- a/docs/AUTHORS.md
+++ b/docs/AUTHORS.md
@@ -200,7 +200,6 @@ Users are anyone using Marked in some fashion, without them, there's no reason f
|Individual or Organization |Website |Project |Submitted by |
|:--------------------------|:-----------------------|:------------------------------------|:---------------------------------------------------|
|MarkedJS |https://marked.js.org |https://github.com/markedjs/marked |The marked committers |
-|Altilunium |https://md.altilunium.my.id|https://github.com/altilunium/md |Altilunium |
To be listed: All fields are optional. Contact any of the committers or, more timely, submit a pull request with the following (using the first row as an example):
diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md
index 0fce5a15..665511c1 100644
--- a/docs/CONTRIBUTING.md
+++ b/docs/CONTRIBUTING.md
@@ -10,14 +10,14 @@
- [ ] Run `npm run build:reset` to remove changes to compiled files.
- [ ] Submit a Pull Request.
-## Design principles
+
Design principles
Marked tends to favor following the SOLID set of software design and development principles; mainly the [single responsibility](https://en.wikipedia.org/wiki/Single_responsibility_principle) and [open/closed principles](https://en.wikipedia.org/wiki/Open/closed_principle):
- **Single responsibility:** Marked, and the components of Marked, have the single responsibility of converting Markdown strings into HTML.
- **Open/closed:** Marked favors giving developers the means to easily extend the library and its components over changing Marked's behavior through configuration options.
-## Priorities
+
Priorities
We think we have our priorities sorted to build quality in.
@@ -33,7 +33,7 @@ The following table lists the ticket type labels we use when there is work to be
|NFU - new feature (user requested) |A capability Marked does not currently provide but has been requested by users of Marked. |
|NFE - new feature (should be an extension) |A capability Marked does not currently provide and is not part of a spec. |
-## Test early, often, and everything
+
Test early, often, and everything
We try to write test cases to validate output (writing tests based on the [supported specifications](/#specifications)) and minimize regression (writing tests for issues fixed). Therefore, if you would like to contribute, some things you should know regarding the test harness.
diff --git a/docs/USING_ADVANCED.md b/docs/USING_ADVANCED.md
index 40a8149e..d0664601 100644
--- a/docs/USING_ADVANCED.md
+++ b/docs/USING_ADVANCED.md
@@ -1,4 +1,4 @@
-## Marked instance
+
Marked instance
By default, Marked stores options and extensions in the global scope. That means changing the options in one script will also change the options in another script since they share the same instance.
diff --git a/docs/_document.html b/docs/_document.html
index 4fc452a8..b8e93566 100644
--- a/docs/_document.html
+++ b/docs/_document.html
@@ -38,6 +38,7 @@