From ca57754c411a97cf9b09cd74473099451bcf1248 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 5 May 2019 12:25:22 -0400 Subject: url encoding --- org/default_regex.org | 1 + org/output_xmls.org | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'org') diff --git a/org/default_regex.org b/org/default_regex.org index 911832b..25536ff 100644 --- a/org/default_regex.org +++ b/org/default_regex.org @@ -549,6 +549,7 @@ static inline_link_clean = ctRegex!(`┤(?:.+?)├| static inline_a_url = ctRegex!(`(┤)([^\s┥┝┤├]+)(├)`, "mg"); static url = ctRegex!(`https?://`, "mg"); static uri = ctRegex!(`(?:https?|git)://`, "mg"); +static uri_identify_components = ctRegex!(`(?P(?:https?|git)://)(?P\S+?/)(?P[^/]+)$`, "mg"); static inline_link_subtoc = ctRegex!(`^(?P[5-7])~ ┥(?P.+?)┝┤(?P.+?)├`, "mg"); static fn_suffix = ctRegex!(`\.fnSuffix`, "mg"); static inline_link_fn_suffix = ctRegex!(`¤(.+?)(\.fnSuffix)`, "mg"); diff --git a/org/output_xmls.org b/org/output_xmls.org index 33995bd..21f4876 100644 --- a/org/output_xmls.org +++ b/org/output_xmls.org @@ -473,7 +473,11 @@ auto inline_links(O,M)( if (obj.has.inline_links) { if (obj.metainfo.is_a != "code") { _txt = replaceAll!(m => - m[1] ~ "┤" ~ to!string((obj.stow.link[m["num"].to!ulong])).encode ~ "├" + m[1] ~ "┤" + ~ (replaceAll!(n => + n["type"] ~ n["path"] ~ (n["file"].encodeComponent) + )((obj.stow.link[m["num"].to!ulong]).to!string, rgx.uri_identify_components)) + ~ "├" )(_txt, rgx.inline_link_number_only); } if ((_txt.match(rgx.mark_internal_site_lnk)) -- cgit v1.2.3