You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-24 23:26:50 +02:00
All: Use Lerna to manage monorepo
This commit is contained in:
20
packages/renderer/MdToHtml/rules/code_inline.ts
Normal file
20
packages/renderer/MdToHtml/rules/code_inline.ts
Normal file
@ -0,0 +1,20 @@
|
||||
function plugin(markdownIt:any) {
|
||||
const defaultRender =
|
||||
markdownIt.renderer.rules.code_inline ||
|
||||
function(tokens:any, idx:any, options:any, _env:any, self:any) {
|
||||
return self.renderToken(tokens, idx, options);
|
||||
};
|
||||
|
||||
markdownIt.renderer.rules.code_inline = (tokens:any[], idx:number, options:any, env:any, self:any) => {
|
||||
const token = tokens[idx];
|
||||
let tokenClass = token.attrGet('class');
|
||||
if (!tokenClass) tokenClass = '';
|
||||
tokenClass += ' inline-code';
|
||||
token.attrSet('class', tokenClass.trim());
|
||||
return defaultRender(tokens, idx, options, env, self);
|
||||
};
|
||||
}
|
||||
|
||||
export default {
|
||||
plugin,
|
||||
};
|
Reference in New Issue
Block a user