Files
openchamber-android-native/third_party/mygo/ui/markdown/parser/cjk_emphasis_test.go
T
OpenChamber 6c0ee61750 feat: port the client to MyGo native UI (0.3.0)
Switch from Asuka to MyGo, keeping the API client and the feature set:

- servers: saved servers, passwordless and password login, proxy,
  self-signed certificates, per-server device tokens (Keystore), connect
  form, instance list sheet with switch/disconnect
- sessions: virtualized list, search, new session, rename/archive/delete,
  running indicator, event stream keeps it live
- chat: pushed window with system back bar, streaming Markdown via
  ui/markdown, reasoning and tool rows with image previews, footer menu
  (read aloud via a Kotlin TTS plugin, copy, fork), user message menu
  (copy, revert, fork), context usage ring and detail sheet, attachments
  (photos/files via the document picker), permissions
- release builds allow plain http:// LAN servers (Go's net/http dials
  directly, no cleartext manifest needed)
- a local fork of MyGo (third_party/mygo) lowers the Android host's
  minSdk to 24 (Android 7.0); Go 1.27.4 via mise

Version 0.3.0.
2026-11-18 13:22:59 +08:00

27 lines
1.4 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package parser
import "testing"
// Emphasis closed by CJK punctuation and followed by CJK text, as
// Chinese writes it without spaces.
func TestCJKEmphasis(t *testing.T) {
for src, want := range map[string]string{
"**五种方式都能承载。**下面是判断": "<p><strong>五种方式都能承载。</strong>下面是判断</p>\n",
"**已有可靠内网:直接 HTTP。**接入成本最低。": "<p><strong>已有可靠内网:直接 HTTP。</strong>接入成本最低。</p>\n",
"针对你强调的**“简单”**,我会这样选": "<p>针对你强调的<strong>“简单”</strong>,我会这样选</p>\n",
"~~删除。~~保留": "<p><del>删除。</del>保留</p>\n",
"snake_case_name": "<p>snake_case_name</p>\n",
"a **b** c": "<p>a <strong>b</strong> c</p>\n",
// _ and a single ~ keep CommonMark's rule next to CJK text.
"中文__粗体。__后文": "<p>中文__粗体。__后文</p>\n",
"第1章~“附录”和“序”~第3章": "<p>第1章~“附录”和“序”~第3章</p>\n",
// Latin text with curly quotes reads as before.
"He said “*hello*” to me.": "<p>He said “<em>hello</em>” to me.</p>\n",
"**Alice**’s and **Bob**’s toys": "<p><strong>Alice</strong>’s and <strong>Bob</strong>’s toys</p>\n",
} {
if got := render(src, Default); got != want {
t.Errorf("%q: got %q, want %q", src, got, want)
}
}
}