File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -611,24 +611,24 @@ <h5>Metadata</h5>
611611 // Create a map for quick lookup
612612 const emojiMap = emojis . reduce ( ( map , emoji ) => {
613613 if ( emoji . aliases ) {
614- emoji . aliases . forEach ( ( alias ) => {
615- map [ alias ] = emoji . emoji ;
614+ emoji . aliases . forEach ( alias => {
615+ map [ alias ] = emoji . emoji ; // Map each alias to the corresponding emoji
616616 } ) ;
617617 }
618618 return map ;
619619 } , { } ) ;
620620
621- // Replace emoji shortcodes in text
621+ // Replace emoji shortcodes in the text
622622 const contentElement = document . getElementById ( "content" ) ;
623623 contentElement . innerHTML = contentElement . innerHTML . replace ( / : ( [ a - z A - Z 0 - 9 _ + - ] + ) : / g, ( match , shortcode ) => {
624- return emojiMap [ shortcode ] || match ; // Replace or keep original if not found
624+ return emojiMap [ shortcode ] || match ; // Replace if found, else keep the original
625625 } ) ;
626626 } catch ( error ) {
627627 console . error ( "Failed to fetch emojis:" , error ) ;
628628 }
629629 }
630630
631- // Call the function to replace emojis
631+ // Run the function to replace emojis
632632 replaceEmojis ( ) ;
633633 </ script >
634634</ body >
You can’t perform that action at this time.
0 commit comments