编辑器保存代码空格丢失?
【公众号】: 程序猫 【浏览器UA】: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 isNewEditor true 【页面链接】: https://mp.weixin.qq.com/cgi-bin/appmsg?t=media/appmsg_edit&action=edit&reprint_confirm=0×tamp=1753864593096&type=77&appmsgid=100000474&token=1375725301&lang=zh_CN 【问题描述】: 代码片段复制到微信编辑器,然后保存,代码的空格丢失,没找到规律: 保存前正常: [图片] 保存后空格丢失: [图片] 测试代码:(是第三方工具带样式复制过去的,这个代码示例不一定能重现)
// 测试代码
public test(): boolean {
const scaledMatrix: number[][] = [];
let hasFallen = false;
for (let y = BOARD_HEIGHT - 2; y >= 0; y--) {
for (let x = 0; x < BOARD_WIDTH; x++) {
const cell = this.getCell(x, y);
if (cell == 1) {
continue;
}
}
}
return hasFallen;
}