mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: 即时预览astyle-format
This commit is contained in:
1 parent
a89d8bfde8
commit
92986442d4
5 files changed
+193
-3
No files matched your search
@@ -110,7 +110,7 @@ const prismjsApiWrap = {
|
||||
console.log(success.result);
|
||||
code.original = $code.text();
|
||||
if (!success) Notification.error('Code format fail');
|
||||
else $code.text(result.replace(/^#(include|import)[\t ]*(<|")/gm, (match, p1, p2) => `#${p1} ${p2}`));
|
||||
else $code.text(result);
|
||||
}
|
||||
// try to map the language name
|
||||
const m = language.match(/language-([a-z]+)/);
|
||||
@@ -123,6 +123,8 @@ const prismjsApiWrap = {
|
||||
Prism.highlightElement(code);
|
||||
});
|
||||
},
|
||||
highlight: (text, grammar, language) => Prism.highlight(text, grammar, language),
|
||||
Prism,
|
||||
};
|
||||
|
||||
export default prismjsApiWrap;
|
||||
Reference in new issue
Block a user