Skip to content

Commit

Permalink
Merge branch 'noprint' into lint
Browse files Browse the repository at this point in the history
bhsd-harry committed Jan 9, 2025

Verified

This commit was signed with the committer’s verified signature.
mrgrain Momo Kornher
2 parents 25d4eed + 8724241 commit 7a9a126
Showing 2 changed files with 11 additions and 10 deletions.
15 changes: 8 additions & 7 deletions lib/title.ts
Original file line number Diff line number Diff line change
@@ -115,13 +115,14 @@ export class Title {

/** @private */
toString(display?: boolean): string {
return `${display ? this.title.replace(/_/gu, ' ') : this.title}${
this.#fragment === undefined
? ''
: `#${
this.#fragment
}`
}`;
return (display ? this.title.replace(/_/gu, ' ') : this.title)
+ (
this.#fragment === undefined
? ''
: `#${
this.#fragment
}`
);
}

/** 检测是否是重定向 */
6 changes: 3 additions & 3 deletions src/transclude.ts
Original file line number Diff line number Diff line change
@@ -201,9 +201,9 @@ export abstract class TranscludeToken extends Token {
override toString(skip?: boolean): string {
return `{{${this.modifier}${
this.type === 'magic-word'
? `${this.firstChild.toString(skip)}${this.length === 1 ? '' : ':'}${
this.childNodes.slice(1).map(child => child.toString(skip)).join('|')
}`
? this.firstChild.toString(skip)
+ (this.length === 1 ? '' : ':')
+ this.childNodes.slice(1).map(child => child.toString(skip)).join('|')
: super.toString(skip, '|')
}}}`;
}

0 comments on commit 7a9a126

Please sign in to comment.