Move microsyntax parsers to mastodon_api::statuses::microsyntax module
This commit is contained in:
parent
ac6491d030
commit
5ba8b8d6ae
8 changed files with 12 additions and 9 deletions
|
@ -6,15 +6,17 @@ use crate::database::{DatabaseClient, DatabaseError};
|
|||
use crate::models::{
|
||||
emojis::types::DbEmoji,
|
||||
posts::{
|
||||
emojis::find_emojis,
|
||||
hashtags::{find_hashtags, replace_hashtags},
|
||||
helpers::{add_related_posts, add_user_actions},
|
||||
links::{replace_object_links, find_linked_posts},
|
||||
mentions::{find_mentioned_profiles, replace_mentions},
|
||||
types::Post,
|
||||
},
|
||||
users::types::User,
|
||||
};
|
||||
use super::microsyntax::{
|
||||
emojis::find_emojis,
|
||||
hashtags::{find_hashtags, replace_hashtags},
|
||||
links::{replace_object_links, find_linked_posts},
|
||||
mentions::{find_mentioned_profiles, replace_mentions},
|
||||
};
|
||||
use super::types::Status;
|
||||
|
||||
pub struct PostContent {
|
||||
|
|
|
@ -4,7 +4,7 @@ use regex::{Captures, Match, Regex};
|
|||
|
||||
use crate::activitypub::fetcher::helpers::get_post_by_object_id;
|
||||
use crate::database::{DatabaseClient, DatabaseError};
|
||||
use super::types::{Post, Visibility};
|
||||
use crate::models::posts::types::{Post, Visibility};
|
||||
|
||||
// MediaWiki-like syntax: [[url|text]]
|
||||
const OBJECT_LINK_SEARCH_RE: &str = r"(?m)\[\[(?P<url>[^\s\|]+)(\|(?P<text>.+?))?\]\]";
|
4
src/mastodon_api/statuses/microsyntax/mod.rs
Normal file
4
src/mastodon_api/statuses/microsyntax/mod.rs
Normal file
|
@ -0,0 +1,4 @@
|
|||
pub mod emojis;
|
||||
pub mod hashtags;
|
||||
pub mod links;
|
||||
pub mod mentions;
|
|
@ -1,3 +1,4 @@
|
|||
pub mod helpers;
|
||||
mod microsyntax;
|
||||
pub mod types;
|
||||
pub mod views;
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
pub mod emojis;
|
||||
pub mod hashtags;
|
||||
pub mod helpers;
|
||||
pub mod links;
|
||||
pub mod mentions;
|
||||
pub mod queries;
|
||||
pub mod types;
|
||||
|
|
Loading…
Reference in a new issue