parent
c85db8ac2a
commit
c828c00352
1 changed files with 1 additions and 1 deletions
|
@ -28,7 +28,7 @@ pub fn read_dir(dir: &PathBuf) -> Vec<String> {
|
||||||
|
|
||||||
/// Rewrite all URLs in `input` to the format `/s/<domain>/<path..>`
|
/// Rewrite all URLs in `input` to the format `/s/<domain>/<path..>`
|
||||||
fn internalize_urls(input: &str, base: &str) -> String {
|
fn internalize_urls(input: &str, base: &str) -> String {
|
||||||
let url_pattern = r#"(\s|"|')(?:(<?)(https?:\/\/([a-zA-Z0-9.-]+))?(\/[\w./-]*))"#;
|
let url_pattern = r#"(\ |"|')(?:(<?)(https?:\/\/([a-zA-Z0-9.-]+))?(\/[\w./-]*))"#;
|
||||||
let re = regex::Regex::new(url_pattern).unwrap();
|
let re = regex::Regex::new(url_pattern).unwrap();
|
||||||
|
|
||||||
re.replace_all(input, |caps: ®ex::Captures| {
|
re.replace_all(input, |caps: ®ex::Captures| {
|
||||||
|
|
Loading…
Add table
Reference in a new issue