chore: 更新依赖并支持从 etcd 读取配置。
This commit is contained in:
@ -12,7 +12,7 @@ import { Article } from './entities/article.entity';
|
||||
import { CreateArticleInput } from './dto/create-article.input';
|
||||
import { UpdateArticleInput } from './dto/update-article.input';
|
||||
import * as marked from 'marked';
|
||||
import { getLanguage, highlight } from 'highlight.js';
|
||||
import highlight from 'highlight.js';
|
||||
import { AccountRole, Roles } from '@nestjs-lib/auth';
|
||||
|
||||
@Resolver(() => Article)
|
||||
@ -65,8 +65,8 @@ export class ArticlesResolver {
|
||||
smartypants: true,
|
||||
langPrefix: 'hljs language-',
|
||||
highlight: (code, language) => {
|
||||
return highlight(code, {
|
||||
language: getLanguage(language) ? language : 'plaintext',
|
||||
return highlight.highlight(code, {
|
||||
language: highlight.getLanguage(language) ? language : 'plaintext',
|
||||
}).value;
|
||||
},
|
||||
});
|
||||
|
Reference in New Issue
Block a user