@@ -3,9 +3,11 @@ import sanitizeHtml from 'sanitize-html'
33import { hasProtocol } from 'ufo'
44import type { ReadmeResponse , TocItem } from '#shared/types/readme'
55import { convertBlobOrFileToRawUrl , type RepositoryInfo } from '#shared/utils/git-providers'
6- import { highlightCodeSync } from './shiki '
6+ import { decodeHtmlEntities } from '#shared/utils/html '
77import { convertToEmoji } from '#shared/utils/emoji'
88
9+ import { highlightCodeSync } from './shiki'
10+
911/**
1012 * Playground provider configuration
1113 */
@@ -371,8 +373,8 @@ export async function renderReadmeHtml(
371373 // (e.g., #install, #dependencies, #versions are used by the package page)
372374 const id = `user-content-${ uniqueSlug } `
373375
374- // Collect TOC item with plain text (HTML stripped)
375- const plainText = text . replace ( / < [ ^ > ] * > / g, '' ) . trim ( )
376+ // Collect TOC item with plain text (HTML stripped, entities decoded )
377+ const plainText = decodeHtmlEntities ( text . replace ( / < [ ^ > ] * > / g, '' ) . trim ( ) )
376378 if ( plainText ) {
377379 toc . push ( { text : plainText , id, depth } )
378380 }
@@ -511,7 +513,7 @@ ${html}
511513 * provide the text of the element. This will automatically be removed, because there
512514 * is an allow list for link attributes.
513515 * */
514- label : attribs [ 'data-title-intermediate' ] || provider . name ,
516+ label : decodeHtmlEntities ( attribs [ 'data-title-intermediate' ] || provider . name ) ,
515517 } )
516518 }
517519
0 commit comments