parent
20aeb7edac
commit
4372226a2a
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#"(?:(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
Add a link
Reference in a new issue