File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ export function autolink(html, language) {
4646 if ( status === 'prefix' ) {
4747 if ( elem . className === 'hljs-symbol' ) {
4848 prefix = elem . textContent . replace ( / : $ / , '' ) ;
49- } else if ( prefix && elem . className === 'hljs-literal' ) {
49+ } else if ( prefix !== null && elem . className === 'hljs-literal' ) {
5050 prefixes [ prefix ] = elem . textContent . replace ( / ^ < | > $ / g, '' ) ;
5151 elem . innerHTML = `<<span href="${ prefixes [ prefix ] } " title="${ prefixes [ prefix ] } ">${ prefixes [ prefix ] } </span>>` ;
5252 prefix = null ;
@@ -73,9 +73,7 @@ export function autolink(html, language) {
7373 }
7474 let localPart = elem . textContent . substring ( colon + 1 ) ,
7575 url ;
76- if ( colon === 0 && base ) {
77- url = base + localPart ;
78- } else if ( colon > - 1 ) {
76+ if ( colon > - 1 ) {
7977 const prefix = elem . textContent . substring ( 0 , colon ) ;
8078 if ( prefixes [ prefix ] ) {
8179 url = prefixes [ prefix ] + localPart ;
You can’t perform that action at this time.
0 commit comments