Skip to content

Commit 52151ba

Browse files
committed
fixing things the merge broke
1 parent 479a1c4 commit 52151ba

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

server/utils/readme.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ function normalizePreservedAnchorAttrs(attrs: string): string {
290290
return cleanedAttrs ? ` ${cleanedAttrs}` : ''
291291
}
292292

293-
const isNpmJsUrlThatCanBeRedirected = (url: URL) => {
293+
export const isNpmJsUrlThatCanBeRedirected = (url: URL) => {
294294
if (!npmJsHosts.has(url.host)) {
295295
return false
296296
}
@@ -408,7 +408,7 @@ function resolveImageUrl(url: string, packageName: string, repoInfo?: Repository
408408

409409
// Helper to prefix id attributes with 'user-content-'
410410

411-
function prefixId(tagName: string, attribs: sanitizeHtml.Attributes) {
411+
export function prefixId(tagName: string, attribs: sanitizeHtml.Attributes) {
412412
if (attribs.id) {
413413
attribs.id = withUserContentPrefix(attribs.id)
414414
}

shared/utils/html.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ export function stripHtmlTags(text: string): string {
3636
* - Collapse multiple hyphens
3737
*/
3838
export function slugify(text: string): string {
39-
return stripHtmlTags(text)
40-
.replace(/ ?/g, '') // remove non breaking spaces
39+
return decodeHtmlEntities(stripHtmlTags(text))
4140
.toLowerCase()
4241
.trim()
4342
.replace(/\s+/g, '-') // Spaces to hyphens

0 commit comments

Comments
 (0)