fix(bridge): handle undefined term.description in strip_html

Now that _embed works correctly, WordPress returns full wp:term data where
some categories have undefined description fields. Guard strip_html against
null/undefined input.

Co-Authored-By: Paperclip <[email protected]>
This commit is contained in:
Artur MoreiraandPaperclip committed 2026-03-27 11:42:02 +00:00
1 parent 53f37b27b0
commit 563136ff00
1 file changed
+2 -1
+2 -1
View File
@@ -12,7 +12,8 @@ import type {
const EMBED_VALUE = 'wp:featuredmedia,author,wp:term';
function strip_html(html: string): string {
function strip_html(html: string | undefined | null): string {
if (!html) return '';
return html.replace(/<[^>]+>/g, '').replace(/&[a-z]+;/gi, ' ').trim();
}