From 4aafdeb494203619516904f8ee94fb2901887543 Mon Sep 17 00:00:00 2001
From: Mimi <1119186082@qq.com>
Date: Sat, 11 Jun 2022 16:15:48 +0800
Subject: [PATCH] feat(tag/include_code): robust for url compuation of `view
raw`
---
lib/plugins/tag/include_code.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/plugins/tag/include_code.js b/lib/plugins/tag/include_code.js
index 59e4436a16..a7cd9f6c3a 100644
--- a/lib/plugins/tag/include_code.js
+++ b/lib/plugins/tag/include_code.js
@@ -1,7 +1,7 @@
'use strict';
const { exists, readFile } = require('hexo-fs');
-const { basename, extname, join } = require('path');
+const { basename, extname, join, posix } = require('path');
// Lazy require highlight.js & prismjs
let highlight, prismHighlight;
@@ -55,7 +55,7 @@ module.exports = ctx => function includeCodeTag(args) {
// If the title is not defined, use file name instead
const title = match[1] || basename(path);
- const caption = `${title}view raw`;
+ const caption = `${title}view raw`;
const hljsCfg = ctx.config.highlight || {};
const prismjsCfg = ctx.config.prismjs || {};