forked from mirrors/misskey
インラインのコードでもシンタックスハイライトを有効化
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
* Code (inline)
|
||||
*/
|
||||
|
||||
const genHtml = require('../core/syntax-highlighter');
|
||||
|
||||
module.exports = text => {
|
||||
const match = text.match(/^`(.+?)`/);
|
||||
if (!match) return null;
|
||||
@@ -9,6 +11,7 @@ module.exports = text => {
|
||||
return {
|
||||
type: 'inline-code',
|
||||
content: code,
|
||||
code: code.substr(1, code.length - 2).trim()
|
||||
code: code.substr(1, code.length - 2).trim(),
|
||||
html: genHtml(code.substr(1, code.length - 2).trim())
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user