Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang committed Apr 9, 2024
1 parent 04abf71 commit a640450
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/plugins/tag/include_code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export = (ctx: Hexo) => function includeCodeTag(args: string[]) {
// If the language is not defined, use file extension instead
lang = lang || extname(path).substring(1);

const source = join(codeDir, path);
const source = join(codeDir, path).replace(/\\/g, '/');

// Prevent path traversal: https://github.com/hexojs/hexo/issues/5250
const Page = ctx.model('Page');
Expand Down
4 changes: 2 additions & 2 deletions test/scripts/tags/include_code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ describe('include_code', () => {

it('to', async () => {
const fixture = [
'if (tired && night){',
'if (tired && night) {',
' sleep();'
].join('\n');
const expected = highlight(fixture, {
Expand Down Expand Up @@ -177,7 +177,7 @@ describe('include_code', () => {

it('to', async () => {
const fixture = [
'if (tired && night){',
'if (tired && night) {',
' sleep();'
].join('\n');
const expected = prismHighlight(fixture, {
Expand Down

0 comments on commit a640450

Please sign in to comment.