feat: rendering pipeline logic
This commit is contained in:
13
server/modules/rendering/markdown-expandtabs/definition.yml
Normal file
13
server/modules/rendering/markdown-expandtabs/definition.yml
Normal file
@@ -0,0 +1,13 @@
|
||||
key: markdownExpandtabs
|
||||
title: Expand Tabs
|
||||
description: Replace tabs with spaces in code blocks
|
||||
author: requarks.io
|
||||
icon: space_bar
|
||||
enabledDefault: true
|
||||
dependsOn: markdownCore
|
||||
props:
|
||||
tabWidth:
|
||||
type: Number
|
||||
title: Tab Width
|
||||
hint: Amount of spaces for each tab
|
||||
default: 4
|
14
server/modules/rendering/markdown-expandtabs/renderer.js
Normal file
14
server/modules/rendering/markdown-expandtabs/renderer.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const mdExpandTabs = require('markdown-it-expand-tabs')
|
||||
const _ = require('lodash')
|
||||
|
||||
// ------------------------------------
|
||||
// Markdown - Expand Tabs
|
||||
// ------------------------------------
|
||||
|
||||
module.exports = {
|
||||
init (md, conf) {
|
||||
md.use(mdExpandTabs, {
|
||||
tabWidth: _.toInteger(conf.tabWidth || 4)
|
||||
})
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user