import test from 'node:test'; import assert from 'node:assert/strict'; import { htmlToText } from '../../../lib/utils/html'; test('GH-ISSUE-242: htmlToText removes markup and decodes nbsp content', () => { assert.equal( htmlToText('

简介   内容


第二行 & 片段'), '简介 内容\n\n第二行 & 片段', ); }); test('htmlToText handles numeric, unknown, invalid, and empty entities', () => { assert.equal(htmlToText('一二 🎬 &unknown; �'), '一二 🎬 &unknown; �'); assert.equal(htmlToText(null), ''); });