Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix typo #5245

Merged
merged 1 commit into from Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/box/index.ts
Expand Up @@ -280,13 +280,13 @@ function readDirWalker(ctx, base, results, ignore, prefix) {
if (err && err.code === 'ENOENT') return null;
throw err;
});
const prefixdPath = `${prefix}${path}`;
const prefixPath = `${prefix}${path}`;
if (stats) {
if (stats.isDirectory()) {
return readDirWalker(ctx, fullpath, results, ignore, `${prefixdPath}/`);
return readDirWalker(ctx, fullpath, results, ignore, `${prefixPath}/`);
}
if (!isIgnoreMatch(fullpath, ignore)) {
results.push(prefixdPath);
results.push(prefixPath);
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion lib/extend/syntax_highlight.ts
Expand Up @@ -5,7 +5,7 @@ export interface HighlightOptions {
caption: string | undefined,
lines_length: number,

// plulgins/filter/before_post_render/backtick_code_block
// plugins/filter/before_post_render/backtick_code_block
firstLineNumber?: string | number

// plugins/tag/code.ts
Expand Down
6 changes: 3 additions & 3 deletions lib/extend/tag.ts
Expand Up @@ -57,7 +57,7 @@
return node;
}

run(context, args, body, callback) {

Check warning on line 60 in lib/extend/tag.ts

View workflow job for this annotation

GitHub Actions / linter

'body' is defined but never used

Check warning on line 60 in lib/extend/tag.ts

View workflow job for this annotation

GitHub Actions / linter

'callback' is defined but never used

Check warning on line 60 in lib/extend/tag.ts

View workflow job for this annotation

GitHub Actions / linter

'body' is defined but never used

Check warning on line 60 in lib/extend/tag.ts

View workflow job for this annotation

GitHub Actions / linter

'callback' is defined but never used
return this._run(context, args, '');
}

Expand All @@ -78,14 +78,14 @@
return new nodes.CallExtension(this, 'run', node, [body]);
}

_parseBody(parser, nodes, lexer) {

Check warning on line 81 in lib/extend/tag.ts

View workflow job for this annotation

GitHub Actions / linter

'nodes' is defined but never used

Check warning on line 81 in lib/extend/tag.ts

View workflow job for this annotation

GitHub Actions / linter

'lexer' is defined but never used

Check warning on line 81 in lib/extend/tag.ts

View workflow job for this annotation

GitHub Actions / linter

'nodes' is defined but never used

Check warning on line 81 in lib/extend/tag.ts

View workflow job for this annotation

GitHub Actions / linter

'lexer' is defined but never used
const body = parser.parseUntilBlocks(`end${this.tags[0]}`);

parser.advanceAfterBlockEnd();
return body;
}

run(context, args, body, callback) {

Check warning on line 88 in lib/extend/tag.ts

View workflow job for this annotation

GitHub Actions / linter

'callback' is defined but never used

Check warning on line 88 in lib/extend/tag.ts

View workflow job for this annotation

GitHub Actions / linter

'callback' is defined but never used
return this._run(context, args, trimBody(body));
}
}
Expand Down Expand Up @@ -182,13 +182,13 @@
if (isNaN(errLine)) return err;

// trim useless info from Nunjucks Error
const splited = err.message.split('\n');
const splitted = err.message.split('\n');

const e = new NunjucksError();
e.name = 'Nunjucks Error';
e.line = errLine;
e.location = splited[0];
e.type = splited[1].trim();
e.location = splitted[0];
e.type = splitted[1].trim();
e.message = getContext(input.split(/\r?\n/), errLine, e.location, e.type).join('\n');
return e;
};
Expand Down
4 changes: 2 additions & 2 deletions lib/hexo/index.ts
Expand Up @@ -512,7 +512,7 @@ class Hexo extends EventEmitter {
}, []);
}

_routerReflesh(runningGenerators, useCache) {
_routerRefresh(runningGenerators, useCache) {
const { route } = this;
const routeList = route.list();
const Locals = this._generateLocals();
Expand Down Expand Up @@ -556,7 +556,7 @@ class Hexo extends EventEmitter {

// Run before_generate filters
return this.execFilter('before_generate', this.locals.get('data'), { context: this })
.then(() => this._routerReflesh(this._runGenerators(), useCache)).then(() => {
.then(() => this._routerRefresh(this._runGenerators(), useCache)).then(() => {
this.emit('generateAfter');

// Run after_generate filters
Expand Down
14 changes: 7 additions & 7 deletions lib/hexo/post.ts
Expand Up @@ -287,16 +287,16 @@ class Post {

_renderScaffold(data) {
const { tag } = this.context.extend;
let splited;
let splitted;

return this._getScaffold(data.layout).then(scaffold => {
splited = yfmSplit(scaffold);
const jsonMode = splited.separator.startsWith(';');
splitted = yfmSplit(scaffold);
const jsonMode = splitted.separator.startsWith(';');
const frontMatter = prepareFrontMatter({ ...data }, jsonMode);

return tag.render(splited.data, frontMatter);
return tag.render(splitted.data, frontMatter);
}).then(frontMatter => {
const { separator } = splited;
const { separator } = splitted;
const jsonMode = separator.startsWith(';');

// Parse front-matter
Expand All @@ -310,14 +310,14 @@ class Post {

let content = '';
// Prepend the separator
if (splited.prefixSeparator) content += `${separator}\n`;
if (splitted.prefixSeparator) content += `${separator}\n`;

content += yfmStringify(obj, {
mode: jsonMode ? 'json' : ''
});

// Concat content
content += splited.content;
content += splitted.content;

if (data.content) {
content += `\n${data.content}`;
Expand Down
4 changes: 2 additions & 2 deletions lib/plugins/helper/paginator.ts
Expand Up @@ -34,7 +34,7 @@ const showAll = (tags, options, ctx) => {
}
};

const pagenasionPartShow = (tags, options, ctx) => {
const paginationPartShow = (tags, options, ctx) => {
const {
current,
total,
Expand Down Expand Up @@ -156,7 +156,7 @@ function paginatorHelper(options: Options = {}) {
if (options.show_all) {
showAll(tags, options, this);
} else {
pagenasionPartShow(tags, options, this);
paginationPartShow(tags, options, this);
}

// Display the link to the next page
Expand Down
1 change: 0 additions & 1 deletion lib/plugins/renderer/nunjucks.ts
@@ -1,4 +1,3 @@

import nunjucks from 'nunjucks';
import { readFileSync } from 'hexo-fs';
import { dirname } from 'path';
Expand Down