remove old emoji added, everything emoji-bearing uses RichContent now
This commit is contained in:
parent
4c974f5ca2
commit
97e86381c8
2 changed files with 3 additions and 48 deletions
|
@ -65,8 +65,8 @@ export const parseUser = (data) => {
|
|||
output.fields = data.fields
|
||||
output.fields_html = data.fields.map(field => {
|
||||
return {
|
||||
name: addEmojis(escape(field.name), data.emojis),
|
||||
value: addEmojis(field.value, data.emojis)
|
||||
name: escape(field.name),
|
||||
value: field.value
|
||||
}
|
||||
})
|
||||
output.fields_text = data.fields.map(field => {
|
||||
|
@ -241,16 +241,6 @@ export const parseAttachment = (data) => {
|
|||
|
||||
return output
|
||||
}
|
||||
export const addEmojis = (string, emojis) => {
|
||||
const matchOperatorsRegex = /[|\\{}()[\]^$+*?.-]/g
|
||||
return emojis.reduce((acc, emoji) => {
|
||||
const regexSafeShortCode = emoji.shortcode.replace(matchOperatorsRegex, '\\$&')
|
||||
return acc.replace(
|
||||
new RegExp(`:${regexSafeShortCode}:`, 'g'),
|
||||
`<img src='${emoji.url}' alt=':${emoji.shortcode}:' title=':${emoji.shortcode}:' class='emoji' />`
|
||||
)
|
||||
}, string)
|
||||
}
|
||||
|
||||
export const parseStatus = (data) => {
|
||||
const output = {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue