Fix: also percent-encode ? in filenames

A recent Obsidian update expanded the list of allowed characters in
filenames, which now includes `?` as well. This needs to be
percent-encoded for proper links in static site generators like Hugo.
This commit is contained in:
Nick Groenen 2021-02-16 09:13:04 +01:00
parent 5f615e8ee0
commit f0dd6f7132
No known key found for this signature in database
GPG Key ID: 4F0AD019928AE098

View File

@ -28,7 +28,7 @@ lazy_static! {
static ref OBSIDIAN_NOTE_LINK_RE: Regex =
Regex::new(r"^(?P<file>[^#|]+)??(#(?P<section>.+?))??(\|(?P<label>.+?))??$").unwrap();
}
const PERCENTENCODE_CHARS: &AsciiSet = &CONTROLS.add(b' ').add(b'(').add(b')').add(b'%');
const PERCENTENCODE_CHARS: &AsciiSet = &CONTROLS.add(b' ').add(b'(').add(b')').add(b'%').add(b'?');
const NOTE_RECURSION_LIMIT: usize = 10;
#[non_exhaustive]