parent
b530ae4dc3
commit
3e77ec5008
11 changed files with 476 additions and 346 deletions
|
@ -28,6 +28,7 @@ pub fn read_dir(dir: &PathBuf) -> Vec<String> {
|
|||
|
||||
/// Rewrite all URLs in `input` to the format `/s/<domain>/<path..>`
|
||||
fn internalize_urls(input: &str, base: &str) -> String {
|
||||
// todo : fix regex, domains without path are not captured
|
||||
let url_pattern = r#"(\ |"|')(?:(<?)(https?:\/\/([a-zA-Z0-9.-]+))?(\/[\w./-]*))"#;
|
||||
let re = regex::Regex::new(url_pattern).unwrap();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue