Skip to content

Commit 7018acc

Browse files
committed
Reject metadata list lead-ins
1 parent 751bf22 commit 7018acc

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

web/i18n/audited-seo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const blogDescriptionCandidateKeys: Record<
3838
zenOfCmux: ["summary", "p1", "p2", "p3", "p4"],
3939
cmdShiftU: ["summary", "p1"],
4040
unreadShortcuts: ["summary", "p1", "p2", "p3", "p4", "p5"],
41-
passkeyAuth: ["summary", "p1", "p2", "p3"],
41+
passkeyAuth: ["summary", "p1", "p3"],
4242
};
4343

4444
const conciseTitleLocales = new Set(["ja", "zh-CN", "zh-TW", "ko"]);

web/messages/th.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@
597597
},
598598
"passkeyAuth": {
599599
"metaTitle": "พาสคีย์ในเบราว์เซอร์ cmux",
600-
"metaDescription": "cmux v0.64+ รองรับการยืนยันตัวตนด้วยพาสคีย์ในแผงเบราว์เซอร์ และนำเข้าคุกกี้จากเบราว์เซอร์อื่นได้ด้วย cmux browser import",
600+
"metaDescription": "cmux รองรับพาสคีย์ในเบราว์เซอร์และนำเข้าคุกกี้จากเบราว์เซอร์อื่นสำหรับแอป local ที่ต้องเข้าสู่ระบบ",
601601
"metaKeywords": [
602602
"การยืนยันตัวตนด้วยพาสคีย์ในเบราว์เซอร์ cmux",
603603
"การยืนยันตัวตนด้วยพาสคีย์",

web/tests/seo.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ describe("SEO metadata helpers", () => {
474474
/\{[a-z][a-z0-9_]*\}/iu,
475475
);
476476
expect(row.copy.description).not.toMatch(/[!?؟]\./u);
477-
expect(row.copy.description).not.toMatch(/[:][.]/u);
477+
expect(row.copy.description).not.toMatch(/[:][.!?؟]/u);
478478
expect(row.copy.description).toMatch(/[.!?؟]$/u);
479479
const hasRouteContext = row.contexts.some(
480480
(context) =>
@@ -786,6 +786,9 @@ function plainSeoMessageLookup(messages: object) {
786786
if (value.includes("<")) {
787787
throw new Error(`SEO metadata requested rich message ${key} as plain text`);
788788
}
789+
if (/[:]\s*$/u.test(value)) {
790+
throw new Error(`SEO metadata requested list lead-in ${key} as prose`);
791+
}
789792
return value;
790793
};
791794
}

0 commit comments

Comments
 (0)