chore: 更新依赖并支持从 etcd 读取配置。

This commit is contained in:
2021-10-28 22:07:29 +08:00
parent 6cf4d1b748
commit ece8ccf27a
7 changed files with 9468 additions and 14994 deletions

View File

@ -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;
},
});