fix AP tags with whitespace

This commit is contained in:
les 2020-02-10 00:46:23 +01:00
parent f9e6bce0fc
commit 3325f01cab

View file

@ -40,16 +40,15 @@ module.exports = (sequelize, DataTypes) => {
}
Event.prototype.toNoteAP = function (username, follower = []) {
const tags = this.tags && this.tags.map(t => t.tag.replace(/[ #]/g, ' '))
const tags = this.tags && this.tags.map(t => t.tag.replace(/[ #]/g, '_'))
const tag_links = tags.map(t => {
return `<a href='/tags/${t}' class='mention hashtag status-link' rel='tag'><span>#${t}</span></a>`
}).join(' ')
// @todo: each instance support different note's length
const content = `<a href='${config.baseurl}/event/${this.id}'>${this.title}</a><br/>
📍 ${this.place.name}<br/>
📅 ${moment.unix(this.start_datetime).format('dddd, D MMMM (HH:mm)')}<br/><br/>
${this.description.length > 200 ? this.description.substr(0, 200) + '...' : this.description}<br/>
${this.description.length > 300 ? this.description.substr(0, 300) + '...' : this.description}<br/>
${tag_links} <br/>`
const attachment = []