mirror of
https://github.com/KuekHaoYang/KVideo.git
synced 2026-08-17 17:53:43 +08:00
16 lines
597 B
TypeScript
16 lines
597 B
TypeScript
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('<p>简介 内容</p><br>第二行 & 片段'),
|
|
'简介 内容\n\n第二行 & 片段',
|
|
);
|
|
});
|
|
|
|
test('htmlToText handles numeric, unknown, invalid, and empty entities', () => {
|
|
assert.equal(htmlToText('一二 🎬 &unknown; �'), '一二 🎬 &unknown; �');
|
|
assert.equal(htmlToText(null), '');
|
|
});
|