mirror of
https://github.com/YGGverse/flarumdown.git
synced 2026-03-31 08:45:28 +00:00
keep leading \s+url to skip the thumbnail_url match
This commit is contained in:
parent
6d2fa64314
commit
ccbaa64f19
1 changed files with 2 additions and 1 deletions
|
|
@ -260,7 +260,8 @@ fn main() -> Result<()> {
|
|||
}
|
||||
|
||||
fn pre_format(data: &str, uploads: &mut HashSet<PathBuf>) -> String {
|
||||
const R: &str = r#"(?s)<UPL-IMAGE-PREVIEW\s+alt="([^"]*)"\s+.*?url="([^"]*)"\s+[^>]*>[^<]*</UPL-IMAGE-PREVIEW>"#;
|
||||
// * keep leading `\s+url` to skip the `thumbnail_url` match
|
||||
const R: &str = r#"(?s)<UPL-IMAGE-PREVIEW\s+alt="([^"]*)"\s+.*?\s+url="([^"]*)"\s+[^>]*>[^<]*</UPL-IMAGE-PREVIEW>"#;
|
||||
html_escape::decode_html_entities(&strip_tags::strip_tags(
|
||||
&Regex::new(R).unwrap().replace_all(data, |c: &Captures| {
|
||||
let rel = c[2].trim_start_matches("/").trim_start_matches("d/");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue