markdown-up 3.3.0 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/app.js +5 -1
- package/package.json +1 -1
package/lib/app.js
CHANGED
|
@@ -75,6 +75,9 @@ enum MarkdownUpView
|
|
|
75
75
|
* The MarkdownUp application options
|
|
76
76
|
*
|
|
77
77
|
* @typedef {Object} MarkdownUpOptions
|
|
78
|
+
* @property {?Object.<string, function>} [codeBlocks = null] - The
|
|
79
|
+
* [code block]{@link https://craigahobbs.github.io/markdown-model/module-lib_elements.html#~CodeBlockFn}
|
|
80
|
+
* render function map
|
|
78
81
|
* @property {?boolean} [darkMode = false] - If true, use dark mode by default
|
|
79
82
|
* @property {?number} [fontSize = 12] - The font size, in points
|
|
80
83
|
* @property {?Object} [globals = null] - Global script runtime variables
|
|
@@ -101,6 +104,7 @@ export class MarkdownUp {
|
|
|
101
104
|
this.params = null;
|
|
102
105
|
this.paramsLocal = null;
|
|
103
106
|
this.paramsSession = null;
|
|
107
|
+
this.codeBlocks = (options !== null ? options.codeBlocks : null) ?? null;
|
|
104
108
|
this.darkMode = (options !== null ? options.darkMode : null) ??
|
|
105
109
|
(this.window.matchMedia && this.window.matchMedia('(prefers-color-scheme: dark)').matches);
|
|
106
110
|
this.fontSize = (options !== null ? options.fontSize : null) ?? 12;
|
|
@@ -403,7 +407,7 @@ export class MarkdownUp {
|
|
|
403
407
|
// Create the markdown options object
|
|
404
408
|
const urlFn = (url) => this.modifyURL(url);
|
|
405
409
|
const markdownOptions = {
|
|
406
|
-
'codeBlocks': {},
|
|
410
|
+
'codeBlocks': this.codeBlocks ?? {},
|
|
407
411
|
urlFn,
|
|
408
412
|
'headerIds': true,
|
|
409
413
|
'usedHeaderIds': new Set()
|