make hashtags work in profile summary (#562)

* make hashtags work in profile summary

fix #541

* cargo fmt
This commit is contained in:
fdb-hiroshima
2019-05-04 17:33:50 +02:00
committed by GitHub
parent c9070930d2
commit c52aac012c
9 changed files with 36 additions and 25 deletions
+1 -1
View File
@@ -117,7 +117,7 @@ pub fn create(
let domain = &Instance::get_local(conn)?.public_domain;
let (content, mentions, hashtags) = md_to_html(
&payload.source,
domain,
Some(domain),
false,
Some(Media::get_media_processor(conn, vec![&author])),
);
+1 -1
View File
@@ -293,7 +293,7 @@ pub fn update(
blog.summary_html = SafeString::new(
&utils::md_to_html(
&form.summary,
"",
None,
true,
Some(Media::get_media_processor(
&conn,
+5 -3
View File
@@ -42,9 +42,11 @@ pub fn create(
.map(|_| {
let (html, mentions, _hashtags) = utils::md_to_html(
form.content.as_ref(),
&Instance::get_local(&conn)
.expect("comments::create: local instance error")
.public_domain,
Some(
&Instance::get_local(&conn)
.expect("comments::create: local instance error")
.public_domain,
),
true,
Some(Media::get_media_processor(&conn, vec![&user])),
);
+10 -6
View File
@@ -262,9 +262,11 @@ pub fn update(
} else {
let (content, mentions, hashtags) = utils::md_to_html(
form.content.to_string().as_ref(),
&Instance::get_local(&conn)
.expect("posts::update: Error getting local instance")
.public_domain,
Some(
&Instance::get_local(&conn)
.expect("posts::update: Error getting local instance")
.public_domain,
),
false,
Some(Media::get_media_processor(
&conn,
@@ -432,9 +434,11 @@ pub fn create(
let (content, mentions, hashtags) = utils::md_to_html(
form.content.to_string().as_ref(),
&Instance::get_local(&conn)
.expect("post::create: local instance error")
.public_domain,
Some(
&Instance::get_local(&conn)
.expect("post::create: local instance error")
.public_domain,
),
false,
Some(Media::get_media_processor(
&conn,