兼容性实验三:数学、代码与图片
test fixture
commitc0ffee3
Author:strtus
Date:2026-08-14 09:30:00
Branch:compatibility-lab
tree · 7
数学、代码与媒体
这篇夹具把容易造成横向溢出的内容集中在一起。所有滚动都应限制在内容块内部。
行内与块级数学
行内公式 、概率 应与中文基线自然对齐。
块级公式:
矩阵:
故意很宽的表达式:
TypeScript 代码
type Commit = {
id: string;
branch: string;
tags: readonly string[];
};
export function groupByBranch(commits: readonly Commit[]) {
return commits.reduce<Record<string, Commit[]>>((groups, commit) => {
(groups[commit.branch] ??= []).push(commit);
return groups;
}, {});
}
Python、Shell 与 JSON
def discounted_return(rewards: list[float], gamma: float) -> float:
return sum((gamma ** step) * reward for step, reward in enumerate(rewards))
npm run verify
npm run build
{
"canonicalRoute": "/branches",
"legacyRedirect": "/topics → /branches",
"status": 308
}
下面一行故意超长,代码块应横向滚动:
0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz_0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz
本地图片:横向比例
横图应限制在正文宽度内,保留比例,不发生拉伸。
本地图片:纵向比例
纵图不应超过容器宽度;在手机和桌面上都应保持完整。
图片后的普通内容
图片后继续出现文字,用于观察懒加载、布局位移与段落间距。这里还有一个 站内链接 和 inline-code-with-a-long-name()。