1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-08-11 00:03:48 +00:00

refactor: fold commentText variable

This commit is contained in:
lin onetwo 2025-03-09 23:31:15 +08:00
parent 8ab12738cf
commit 711bf01049
2 changed files with 2 additions and 4 deletions

View File

@ -53,11 +53,10 @@ exports.parse = function() {
// Return a node representing the comment that is not rendered // Return a node representing the comment that is not rendered
var commentStart = this.match.index; var commentStart = this.match.index;
var commentEnd = this.endMatch.index + this.endMatch[0].length; var commentEnd = this.endMatch.index + this.endMatch[0].length;
var commentText = this.parser.source.slice(commentStart, commentEnd);
return [{ return [{
type: "void", type: "void",
children: [], children: [],
text: commentText, text: this.parser.source.slice(commentStart, commentEnd),
start: commentStart, start: commentStart,
end: commentEnd end: commentEnd
}]; }];

View File

@ -46,10 +46,9 @@ exports.parse = function() {
// Return a node representing the inline comment // Return a node representing the inline comment
var commentStart = this.match.index; var commentStart = this.match.index;
var commentEnd = this.endMatch.index + this.endMatch[0].length; var commentEnd = this.endMatch.index + this.endMatch[0].length;
var commentText = this.parser.source.slice(commentStart, commentEnd);
return [{ return [{
type: "void", type: "void",
text: commentText, text: this.parser.source.slice(commentStart, commentEnd),
start: commentStart, start: commentStart,
end: commentEnd end: commentEnd
}]; }];