mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
开发者文档
This commit is contained in:
1 parent
3e9b074e77
commit
e7ce8c1f02
42 files changed
+349
-297
No files matched your search
@@ -7,7 +7,7 @@ const loadLanguages = require('prismjs/components/');
|
||||
loadLanguages(['js', 'javascript', 'go', 'c', 'pascal', 'hs', 'java', 'cs', 'cpp', 'py', 'ruby']);
|
||||
|
||||
class Markdown extends MarkdownIt {
|
||||
constructor() {
|
||||
constructor(safe) {
|
||||
super({
|
||||
linkify: true,
|
||||
highlight(str, lang) {
|
||||
@@ -18,9 +18,13 @@ class Markdown extends MarkdownIt {
|
||||
}
|
||||
return '';
|
||||
},
|
||||
html: !safe,
|
||||
});
|
||||
this.linkify.tlds('.py', false);
|
||||
this.use(katex);
|
||||
}
|
||||
}
|
||||
module.exports = new Markdown();
|
||||
module.exports = {
|
||||
unsafe: new Markdown(false),
|
||||
safe: new Markdown(true),
|
||||
};
|
||||
Reference in new issue
Block a user