mirror of
https://github.com/YGGverse/flarumdown.git
synced 2026-03-31 16:55:29 +00:00
fix relative references
This commit is contained in:
parent
04fd8036e3
commit
1c0df42fb4
1 changed files with 9 additions and 1 deletions
10
src/main.rs
10
src/main.rs
|
|
@ -228,9 +228,15 @@ fn pre_format(data: &str, uploads: &mut HashSet<PathBuf>) -> String {
|
||||||
.captures(&c[1])
|
.captures(&c[1])
|
||||||
.unwrap()[1]
|
.unwrap()[1]
|
||||||
.trim_start_matches("/")
|
.trim_start_matches("/")
|
||||||
|
.replace("d/", "")
|
||||||
.into(),
|
.into(),
|
||||||
);
|
);
|
||||||
format!("<img{}>", c[1].replace(" url=", " src="))
|
format!(
|
||||||
|
"<img{}>",
|
||||||
|
c[1].replace(" url=\"/", " src=\"")
|
||||||
|
.replace(" url=\"d/", " src=\"")
|
||||||
|
.replace(" url=", " src=")
|
||||||
|
)
|
||||||
}),
|
}),
|
||||||
"",
|
"",
|
||||||
),
|
),
|
||||||
|
|
@ -242,6 +248,8 @@ fn pre_format(data: &str, uploads: &mut HashSet<PathBuf>) -> String {
|
||||||
.replace("</LIST>", "</ul>")
|
.replace("</LIST>", "</ul>")
|
||||||
.replace("<URL", "<a")
|
.replace("<URL", "<a")
|
||||||
.replace("</URL>", "</a>")
|
.replace("</URL>", "</a>")
|
||||||
|
.replace(" url=\"/", " href=\"")
|
||||||
|
.replace(" url=\"d/", " href=\"")
|
||||||
.replace(" url=", " href=")
|
.replace(" url=", " href=")
|
||||||
.replace("<r>", "")
|
.replace("<r>", "")
|
||||||
.replace("</r>", "")
|
.replace("</r>", "")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue