diff --git a/skills/baoyu-markdown-to-html/scripts/vendor/baoyu-md/src/content.ts b/skills/baoyu-markdown-to-html/scripts/vendor/baoyu-md/src/content.ts
index 6be2b51..0bc73c5 100644
--- a/skills/baoyu-markdown-to-html/scripts/vendor/baoyu-md/src/content.ts
+++ b/skills/baoyu-markdown-to-html/scripts/vendor/baoyu-md/src/content.ts
@@ -46,6 +46,45 @@ export function stripWrappingQuotes(value: string): string {
return value.trim();
}
+const HTML_ENTITIES: Record = {
+ amp: "&",
+ apos: "'",
+ gt: ">",
+ lt: "<",
+ nbsp: " ",
+ quot: '"',
+};
+
+function decodeHtmlCodePoint(codePoint: number, fallback: string): string {
+ if (!Number.isFinite(codePoint) || codePoint < 0 || codePoint > 0x10ffff) {
+ return fallback;
+ }
+ return String.fromCodePoint(codePoint);
+}
+
+function decodeHtmlEntities(value: string): string {
+ return value.replace(/&(#x?[0-9a-f]+|[a-z]+);/gi, (entity, body: string) => {
+ const normalized = body.toLowerCase();
+ if (normalized.startsWith("#x")) {
+ return decodeHtmlCodePoint(Number.parseInt(normalized.slice(2), 16), entity);
+ }
+ if (normalized.startsWith("#")) {
+ return decodeHtmlCodePoint(Number.parseInt(normalized.slice(1), 10), entity);
+ }
+ return HTML_ENTITIES[normalized] ?? entity;
+ });
+}
+
+export function cleanSummaryText(value: string): string {
+ return decodeHtmlEntities(stripWrappingQuotes(value))
+ .replace(/