fix AP tags with whitespace
This commit is contained in:
@@ -40,16 +40,15 @@ module.exports = (sequelize, DataTypes) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Event.prototype.toNoteAP = function (username, follower = []) {
|
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 => {
|
const tag_links = tags.map(t => {
|
||||||
return `<a href='/tags/${t}' class='mention hashtag status-link' rel='tag'><span>#${t}</span></a>`
|
return `<a href='/tags/${t}' class='mention hashtag status-link' rel='tag'><span>#${t}</span></a>`
|
||||||
}).join(' ')
|
}).join(' ')
|
||||||
|
|
||||||
// @todo: each instance support different note's length
|
|
||||||
const content = `<a href='${config.baseurl}/event/${this.id}'>${this.title}</a><br/>
|
const content = `<a href='${config.baseurl}/event/${this.id}'>${this.title}</a><br/>
|
||||||
📍 ${this.place.name}<br/>
|
📍 ${this.place.name}<br/>
|
||||||
📅 ${moment.unix(this.start_datetime).format('dddd, D MMMM (HH:mm)')}<br/><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/>`
|
${tag_links} <br/>`
|
||||||
|
|
||||||
const attachment = []
|
const attachment = []
|
||||||
|
|||||||
Reference in New Issue
Block a user