fix: 转义参数之后应该添加至渲染队列,即使报错

This commit is contained in:
unanmed 2025-06-12 16:25:58 +08:00
parent 9628d7acb7
commit d77918d29c

View File

@ -698,11 +698,11 @@ export class TextContentParser {
if (!param) { if (!param) {
// 参数为空或没有参数,视为标签结束 // 参数为空或没有参数,视为标签结束
const color = this.fillStyleStack.pop(); const color = this.fillStyleStack.pop();
if (this.resolved.length > 0) this.addTextRenderable();
if (!color) { if (!color) {
logger.warn(54, '\\r', pointer.toString()); logger.warn(54, '\\r', pointer.toString());
return end; return end;
} }
if (this.resolved.length > 0) this.addTextRenderable();
this.status.fillStyle = color; this.status.fillStyle = color;
return end; return end;
} else { } else {
@ -719,11 +719,11 @@ export class TextContentParser {
if (!param) { if (!param) {
// 参数为空或没有参数,视为标签结束 // 参数为空或没有参数,视为标签结束
const size = this.fontSizeStack.pop(); const size = this.fontSizeStack.pop();
if (this.resolved.length > 0) this.addTextRenderable();
if (!size) { if (!size) {
logger.warn(54, '\\c', pointer.toString()); logger.warn(54, '\\c', pointer.toString());
return end; return end;
} }
if (this.resolved.length > 0) this.addTextRenderable();
this.status.fontSize = size; this.status.fontSize = size;
this.font = this.buildFont(); this.font = this.buildFont();
return end; return end;
@ -742,11 +742,11 @@ export class TextContentParser {
if (!param) { if (!param) {
// 参数为空或没有参数,视为标签结束 // 参数为空或没有参数,视为标签结束
const font = this.fontFamilyStack.pop(); const font = this.fontFamilyStack.pop();
if (this.resolved.length > 0) this.addTextRenderable();
if (!font) { if (!font) {
logger.warn(54, '\\g', pointer.toString()); logger.warn(54, '\\g', pointer.toString());
return end; return end;
} }
if (this.resolved.length > 0) this.addTextRenderable();
this.status.fontFamily = font; this.status.fontFamily = font;
this.font = this.buildFont(); this.font = this.buildFont();
return end; return end;