@ -1,5 +1,6 @@
import { emojiKeys , emojiHTML , emojiString } from './emoji.js' ;
import { emojiKeys , emojiHTML , emojiString } from './emoji.js' ;
import { uniq } from '../utils.js' ;
import { uniq } from '../utils.js' ;
import { htmlEscape } from 'escape-goat' ;
function makeCollections ( { mentions , emoji } ) {
function makeCollections ( { mentions , emoji } ) {
const collections = [ ] ;
const collections = [ ] ;
@ -24,7 +25,7 @@ function makeCollections({mentions, emoji}) {
return emojiString ( item . original ) ;
return emojiString ( item . original ) ;
} ,
} ,
menuItemTemplate : ( item ) => {
menuItemTemplate : ( item ) => {
return ` <div class="tribute-item"> ${ emojiHTML ( item . original ) } <span> ${ item . original } </span></div> ` ;
return ` <div class="tribute-item"> ${ emojiHTML ( item . original ) } <span> ${ htmlEscape ( item . original ) } </span></div> ` ;
}
}
} ) ;
} ) ;
}
}
@ -36,9 +37,9 @@ function makeCollections({mentions, emoji}) {
menuItemTemplate : ( item ) => {
menuItemTemplate : ( item ) => {
return `
return `
< div class = "tribute-item" >
< div class = "tribute-item" >
< img src = "${item.original.avatar}" / >
< img src = "${htmlEscape( item.original.avatar) }" / >
< span class = "name" > $ { item . original . name } < / s p a n >
< span class = "name" > $ { htmlEscape ( item . original . name ) } < / s p a n >
$ { item . original . fullname && item . original . fullname !== '' ? ` <span class="fullname"> ${ item . original . fullname } </span> ` : '' }
$ { item . original . fullname && item . original . fullname !== '' ? ` <span class="fullname"> ${ htmlEscape ( item . original . fullname ) } </span> ` : '' }
< / d i v >
< / d i v >
` ;
` ;
}
}