fix(brand): require TKMind platform marker on wechat page delivery
Backfill missing platform-brand footer at serve time and block service- account links when the HTML file omits data-mindspace-page-tag. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -3,6 +3,7 @@ import test from 'node:test';
|
||||
import {
|
||||
MINDSPACE_PAGE_TAG_ATTR,
|
||||
MINDSPACE_PAGE_TAG_PLATFORM_BRAND,
|
||||
ensurePlatformBrandFooter,
|
||||
ensurePlatformBrandPageTags,
|
||||
normalizePlatformBrandHtml,
|
||||
prepareHtmlPageBrandMarkers,
|
||||
@@ -28,3 +29,10 @@ test('prepareHtmlPageBrandMarkers keeps existing marker', () => {
|
||||
const result = prepareHtmlPageBrandMarkers(html);
|
||||
assert.equal(result.match(new RegExp(MINDSPACE_PAGE_TAG_ATTR, 'g'))?.length, 1);
|
||||
});
|
||||
|
||||
test('ensurePlatformBrandFooter appends brand line when marker is missing', () => {
|
||||
const html = '<html><body><main>content</main></body></html>';
|
||||
const result = ensurePlatformBrandFooter(html);
|
||||
assert.match(result, /data-mindspace-page-tag="platform-brand"/);
|
||||
assert.match(result, /TKMind · 智趣/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user