feat: sub+sup+imsize markdown renderers
This commit is contained in:
18
server/modules/rendering/markdown-supsub/definition.yml
Normal file
18
server/modules/rendering/markdown-supsub/definition.yml
Normal file
@@ -0,0 +1,18 @@
|
||||
key: markdownSupsub
|
||||
title: Subscript/Superscript
|
||||
description: Parse subscript and superscript tags
|
||||
author: requarks.io
|
||||
icon: format_size
|
||||
enabledDefault: true
|
||||
dependsOn: markdownCore
|
||||
props:
|
||||
subEnabled:
|
||||
type: Boolean
|
||||
title: Subscript
|
||||
hint: Enable subscript tags
|
||||
default: true
|
||||
supEnabled:
|
||||
type: Boolean
|
||||
title: Supercript
|
||||
hint: Enable supercript tags
|
||||
default: true
|
17
server/modules/rendering/markdown-supsub/renderer.js
Normal file
17
server/modules/rendering/markdown-supsub/renderer.js
Normal file
@@ -0,0 +1,17 @@
|
||||
const mdSub = require('markdown-it-sub')
|
||||
const mdSup = require('markdown-it-sup')
|
||||
|
||||
// ------------------------------------
|
||||
// Markdown - Subscript / Superscript
|
||||
// ------------------------------------
|
||||
|
||||
module.exports = {
|
||||
init (md, conf) {
|
||||
if (conf.subEnabled) {
|
||||
md.use(mdSub)
|
||||
}
|
||||
if (conf.supEnabled) {
|
||||
md.use(mdSup)
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user