File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -64,11 +64,11 @@ md.renderer.rules.text = (tokens, idx) => {
6464 content = content . replace ( e [ 0 ] , `<span class="serif">${ e [ 0 ] . slice ( 1 , - 1 ) } </span>` ) ;
6565 }
6666 } ) ;
67- [ ...content . matchAll ( / # \S + \s / g ) ] . forEach ( e => {
68- content = content . replace ( e [ 0 ] . trim ( ) , `<mark class="channel-link">${ e [ 0 ] . trim ( ) } </mark>` ) ;
67+ [ ...content . matchAll ( / ( ^ | \s ) ( # [ a - z \d _ - ] + ) / gi ) ] . forEach ( e => {
68+ content = content . replace ( e [ 0 ] . trim ( ) , `<mark class="channel-link">${ e [ 2 ] . trim ( ) } </mark>` ) ;
6969 } ) ;
70- [ ...content . matchAll ( / @ \S + \s / g) ] . forEach ( e => {
71- content = content . replace ( e [ 0 ] . trim ( ) , `<mark class="user-link">${ e [ 0 ] . trim ( ) } </mark>` ) ;
70+ [ ...content . matchAll ( / ( ^ | \s ) ( @ [ a - z \d _ - ] + ) / g) ] . forEach ( e => {
71+ content = content . replace ( e [ 0 ] . trim ( ) , `<mark class="user-link">${ e [ 2 ] . trim ( ) } </mark>` ) ;
7272 } ) ;
7373 [ ...content . matchAll ( / ( h t t p s ? : \/ \/ ) ? e t e r n a ( g a m e | d e v ) .o r g \/ s i t e s \/ d e f a u l t \/ f i l e s \/ c h a t _ s c r e e n s \/ \d + _ \d + \. p n g / g) ] . forEach ( e => {
7474 content = content . replace ( e [ 0 ] . trim ( ) , `<a href="${ e [ 0 ] . trim ( ) } " class="image-link" target="_blank"><img class="screenshot" src="${ e [ 0 ] . trim ( ) } "></a>` ) ;
You can’t perform that action at this time.
0 commit comments