Remove name attribute from link tag

This commit is contained in:
silverpill 2022-10-28 15:29:48 +00:00
parent 1d66f5e864
commit c8b8a5ffe5
4 changed files with 5 additions and 4 deletions

View file

@ -181,7 +181,7 @@ See [FEDERATION.md](./FEDERATION.md)
Most methods are similar to Mastodon API, but Mitra is not fully compatible. Most methods are similar to Mastodon API, but Mitra is not fully compatible.
[OpenAPI spec](./docs/openapi.yaml) (incomplete) [OpenAPI spec](./docs/openapi.yaml)
## CLI ## CLI

View file

@ -125,7 +125,7 @@ pub fn build_note(
// Build FEP-e232 object link // Build FEP-e232 object link
let link_href = linked.object_id(instance_url); let link_href = linked.object_id(instance_url);
let _tag = Tag { let _tag = Tag {
name: Some(format!("RE: {}", link_href)), name: None, // no microsyntax
tag_type: LINK.to_string(), tag_type: LINK.to_string(),
href: Some(link_href), href: Some(link_href),
media_type: Some(AP_MEDIA_TYPE.to_string()), media_type: Some(AP_MEDIA_TYPE.to_string()),

View file

@ -335,7 +335,7 @@ pub async fn frontend_profile_redirect(
let response = HttpResponse::Found() let response = HttpResponse::Found()
.append_header(("Location", actor_id)) .append_header(("Location", actor_id))
.finish(); .finish();
return Ok(response); Ok(response)
} }
#[get("/post/{object_id}")] #[get("/post/{object_id}")]
@ -350,7 +350,7 @@ pub async fn frontend_post_redirect(
let response = HttpResponse::Found() let response = HttpResponse::Found()
.append_header(("Location", object_id)) .append_header(("Location", object_id))
.finish(); .finish();
return Ok(response); Ok(response)
} }
#[cfg(test)] #[cfg(test)]

View file

@ -7,6 +7,7 @@ use crate::errors::DatabaseError;
use super::helpers::get_post_by_object_id; use super::helpers::get_post_by_object_id;
use super::types::Post; use super::types::Post;
// MediaWiki-like syntax: [[url|text]]
const OBJECT_LINK_SEARCH_RE: &str = r"(?m)\[\[(?P<url>[^\s\|]+)(\|(?P<text>.+?))?\]\]"; const OBJECT_LINK_SEARCH_RE: &str = r"(?m)\[\[(?P<url>[^\s\|]+)(\|(?P<text>.+?))?\]\]";
fn is_inside_code_block(caps: &Captures, text: &str) -> bool { fn is_inside_code_block(caps: &Captures, text: &str) -> bool {