File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -221,16 +221,6 @@ const isNpmJsUrlThatCanBeRedirected = (url: URL) => {
221221 return true
222222}
223223
224- const replaceHtmlLink = ( html : string ) => {
225- return html . replace ( / h r e f = " ( [ ^ " ] + ) " / g, ( match , href ) => {
226- if ( isNpmJsUrlThatCanBeRedirected ( new URL ( href , 'https://www.npmjs.com' ) ) ) {
227- const newHref = href . replace ( / ^ h t t p s ? : \/ \/ ( w w w \. ) ? n p m j s \. c o m / , '' )
228- return `href="${ newHref } "`
229- }
230- return match
231- } )
232- }
233-
234224/**
235225 * Resolve a relative URL to an absolute URL.
236226 * If repository info is available, resolve to provider's raw file URLs.
@@ -437,14 +427,7 @@ ${html}
437427 return `<blockquote>${ body } </blockquote>\n`
438428 }
439429
440- marked . setOptions ( {
441- renderer,
442- walkTokens : token => {
443- if ( token . type === 'html' ) {
444- token . text = replaceHtmlLink ( token . text )
445- }
446- } ,
447- } )
430+ marked . setOptions ( { renderer } )
448431
449432 const rawHtml = marked . parse ( content ) as string
450433
You can’t perform that action at this time.
0 commit comments