denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
97.45k stars 5.37k forks source link

`deno fmt` panics for Chinese in markdown #12553

Closed KnorpelSenf closed 3 years ago

KnorpelSenf commented 3 years ago

Title says it all. See this run of GitHub actions for a log: https://github.com/grammyjs/website/runs/4011593260

thread 'tokio-runtime-worker' panicked at 'byte index 79 is not a char boundary; it is inside '把' (bytes 78..81) of `// 处理 commands, 比如 /start
bot.command('start', (ctx) => { ... });

// 把信息文本与一个字符串或正则表达式相匹配
bot.hears(/echo *(.+)?/, (ctx) => { ... });`', C:\Users\runneradmin\.cargo\registry\src\github.com-1ecc6299db9ec823\dprint-core-0.46.4\src\formatting\utils\string_utils.rs:56:19
bartlomieju commented 3 years ago

Please provide example file that causes panic

KnorpelSenf commented 3 years ago

The relevent file in the repo that causes the problem is this one: https://github.com/grammyjs/website/blob/main/site/docs/zh/guide/basics.md