We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8d21027 commit e15ad72Copy full SHA for e15ad72
lib/plugins/renderer/yaml.js
@@ -2,7 +2,19 @@
2
3
const yaml = require('js-yaml');
4
const { escape } = require('hexo-front-matter');
5
-const schema = yaml.DEFAULT_SCHEMA.extend(require('js-yaml-js-types').all);
+const log = require('hexo-log')();
6
+
7
+let schema = {};
8
+// FIXME: workaround for https://github.com/hexojs/hexo/issues/4917
9
+try {
10
+ schema = yaml.DEFAULT_SCHEMA.extend(require('js-yaml-js-types').all);
11
+} catch (e) {
12
+ if (e instanceof yaml.YAMLException) {
13
+ log.warn('YAMLException: please see https://github.com/hexojs/hexo/issues/4917');
14
+ } else {
15
+ throw e;
16
+ }
17
+}
18
19
function yamlHelper(data) {
20
return yaml.load(escape(data.text), { schema });
0 commit comments