seo: add data-nosnippet attribute and improve markdown type negotiation

This commit is contained in:
Dries Augustyns
2026-05-17 11:09:54 +02:00
parent 6759bffd2a
commit 53b631e6c6
3 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ function getQ(types: Array<{ type: string; q: number }>, target: string): number
function negotiate(accept: string): Negotiated {
if (!accept) return 'html';
const types = parseAccept(accept);
const mdQ = getQ(types, 'text/markdown');
const mdQ = types.find(t => t.type === 'text/markdown')?.q ?? -1;
const htmlQ = getQ(types, 'text/html');
if (mdQ <= 0 && htmlQ <= 0) return 'none';
if (mdQ > 0 && mdQ >= htmlQ) return 'markdown';