Add support for hashtags in md parser

This commit is contained in:
Trinity Pointard
2018-10-20 16:38:16 +02:00
parent a6e73f4667
commit 4fa3a0f6ee
5 changed files with 119 additions and 40 deletions
+1 -1
View File
@@ -100,7 +100,7 @@ impl Comment {
}
pub fn into_activity(&self, conn: &Connection) -> Note {
let (html, mentions) = utils::md_to_html(self.content.get().as_ref());
let (html, mentions, _hashtags) = utils::md_to_html(self.content.get().as_ref());
let author = User::get(conn, self.author_id).expect("Comment::into_activity: author error");
let mut note = Note::default();
+2 -2
View File
@@ -117,8 +117,8 @@ impl Instance {
}
pub fn update(&self, conn: &Connection, name: String, open_registrations: bool, short_description: SafeString, long_description: SafeString) {
let (sd, _) = md_to_html(short_description.as_ref());
let (ld, _) = md_to_html(long_description.as_ref());
let (sd, _, _) = md_to_html(short_description.as_ref());
let (ld, _, _) = md_to_html(long_description.as_ref());
diesel::update(self)
.set((
instances::name.eq(name),