From 278e160f4dbdf82bcc4e94de8b5fb076cdd8466f Mon Sep 17 00:00:00 2001 From: Mimi <1119186082@qq.com> Date: Sun, 3 Jan 2021 23:19:50 +0800 Subject: [PATCH] Use `yaml.load` --- scripts/events/lib/vendors.js | 2 +- source/css/_common/scaffolding/base.styl | 2 ++ test/validate/index.js | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/events/lib/vendors.js b/scripts/events/lib/vendors.js index f87256d..26e335e 100644 --- a/scripts/events/lib/vendors.js +++ b/scripts/events/lib/vendors.js @@ -10,7 +10,7 @@ try { } catch (error) { } const vendorsFile = fs.readFileSync(path.join(__dirname, '../../../_vendors.yml')); -const dependencies = yaml.safeLoad(vendorsFile); +const dependencies = yaml.load(vendorsFile); module.exports = hexo => { const { vendors } = hexo.theme.config; diff --git a/source/css/_common/scaffolding/base.styl b/source/css/_common/scaffolding/base.styl index 23e0aa5..ac66fde 100644 --- a/source/css/_common/scaffolding/base.styl +++ b/source/css/_common/scaffolding/base.styl @@ -38,6 +38,8 @@ p { a { border-bottom: 1px solid $link-decoration-color; color: var(--link-color); + // For a:not(:any-link) + cursor: pointer; outline: 0; text-decoration: none; word-wrap(); diff --git a/test/validate/index.js b/test/validate/index.js index 2171158..15d736b 100644 --- a/test/validate/index.js +++ b/test/validate/index.js @@ -9,14 +9,14 @@ describe('Validate', () => { it('config', () => { const themeConfig = fs.readFileSync(path.join(__dirname, '../../_config.yml')); should.not.throw(() => { - yaml.safeLoad(themeConfig); + yaml.load(themeConfig); }); }); it('vendors', () => { const vendorsFile = fs.readFileSync(path.join(__dirname, '../../_vendors.yml')); should.not.throw(() => { - yaml.safeLoad(vendorsFile); + yaml.load(vendorsFile); }); }); @@ -26,7 +26,7 @@ describe('Validate', () => { fs.readdirSync(languagesPath).forEach(lang => { if (!lang.endsWith('.yml')) return; const languagePath = path.join(languagesPath, lang); - yaml.safeLoad(fs.readFileSync(languagePath), { + yaml.load(fs.readFileSync(languagePath), { filename: path.relative(__dirname, languagePath) }); });