@contentrain/emitter-astro 0.18.12 → 0.18.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -820,7 +820,7 @@ const MARK_RE = /@@([a-z0-9_]+)@@/gi
820
820
  export type Values = Record<string, unknown>
821
821
 
822
822
  export const esc = (value: unknown): string =>
823
- String(value ?? '').replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;')
823
+ String(value ?? '').replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;')
824
824
 
825
825
  const isFilled = (value: unknown): boolean =>
826
826
  Array.isArray(value) ? value.length > 0 : value !== undefined && value !== null && value !== ''
@@ -1488,7 +1488,8 @@ export function postMarks(post: MarkablePost): Values {
1488
1488
  author_first: post.author_first ?? '',
1489
1489
  author_last: post.author_last ?? '',
1490
1490
  excerpt: post.excerpt ?? '',
1491
- excerpt_html: post.excerpt_html ?? post.excerpt ?? '',
1491
+ // The plain excerpt is text: escaped here, or a decoded \`<script>\` in it would print as markup.
1492
+ excerpt_html: post.excerpt_html ?? esc(post.excerpt ?? ''),
1492
1493
  body_html: post.body ?? '',
1493
1494
  slug: post.slug,
1494
1495
  feat: post.featured?.[0] ?? '',