make hashtags work in profile summary (#562)
* make hashtags work in profile summary fix #541 * cargo fmt
This commit is contained in:
@@ -107,7 +107,7 @@ impl Comment {
|
||||
let author = User::get(&c.conn, self.author_id)?;
|
||||
let (html, mentions, _hashtags) = utils::md_to_html(
|
||||
self.content.get().as_ref(),
|
||||
&Instance::get_local(&c.conn)?.public_domain,
|
||||
Some(&Instance::get_local(&c.conn)?.public_domain),
|
||||
true,
|
||||
Some(Media::get_media_processor(&c.conn, vec![&author])),
|
||||
);
|
||||
|
||||
@@ -131,13 +131,13 @@ impl Instance {
|
||||
) -> Result<()> {
|
||||
let (sd, _, _) = md_to_html(
|
||||
short_description.as_ref(),
|
||||
&self.public_domain,
|
||||
Some(&self.public_domain),
|
||||
true,
|
||||
Some(Media::get_media_processor(conn, vec![])),
|
||||
);
|
||||
let (ld, _, _) = md_to_html(
|
||||
long_description.as_ref(),
|
||||
&self.public_domain,
|
||||
Some(&self.public_domain),
|
||||
false,
|
||||
Some(Media::get_media_processor(conn, vec![])),
|
||||
);
|
||||
|
||||
@@ -692,7 +692,7 @@ impl FromId<PlumeRocket> for Post {
|
||||
}
|
||||
|
||||
// save mentions and tags
|
||||
let mut hashtags = md_to_html(&post.source, "", false, None)
|
||||
let mut hashtags = md_to_html(&post.source, None, false, None)
|
||||
.2
|
||||
.into_iter()
|
||||
.map(|s| s.to_camel_case())
|
||||
@@ -829,7 +829,7 @@ impl AsObject<User, Update, &PlumeRocket> for PostUpdate {
|
||||
post.license = license;
|
||||
}
|
||||
|
||||
let mut txt_hashtags = md_to_html(&post.source, "", false, None)
|
||||
let mut txt_hashtags = md_to_html(&post.source, None, false, None)
|
||||
.2
|
||||
.into_iter()
|
||||
.map(|s| s.to_camel_case())
|
||||
|
||||
@@ -215,7 +215,7 @@ impl User {
|
||||
users::email.eq(email),
|
||||
users::summary_html.eq(utils::md_to_html(
|
||||
&summary,
|
||||
"",
|
||||
None,
|
||||
false,
|
||||
Some(Media::get_media_processor(conn, vec![self])),
|
||||
)
|
||||
@@ -931,7 +931,7 @@ impl NewUser {
|
||||
display_name,
|
||||
is_admin,
|
||||
summary: summary.to_owned(),
|
||||
summary_html: SafeString::new(&utils::md_to_html(&summary, "", false, None).0),
|
||||
summary_html: SafeString::new(&utils::md_to_html(&summary, None, false, None).0),
|
||||
email: Some(email),
|
||||
hashed_password: Some(password),
|
||||
instance_id: Instance::get_local(conn)?.id,
|
||||
|
||||
Reference in New Issue
Block a user