From f220fd63e511f8629eb219649735f1ba2a36101d Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Fri, 6 Oct 2023 19:14:11 -0400 Subject: [PATCH] Add org-link-parameters to the GlobalSettings. --- src/context/global_settings.rs | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/context/global_settings.rs b/src/context/global_settings.rs index 8b0a9eca..57ab48bf 100644 --- a/src/context/global_settings.rs +++ b/src/context/global_settings.rs @@ -37,6 +37,11 @@ pub struct GlobalSettings<'g, 's> { /// /// Corresponds to org-coderef-label-format elisp variable. pub coderef_label_format: &'g str, + + /// The allowed protocols for links (for example, the "https" in "https://foo.bar/"). + /// + /// COrresponds to org-link-parameters elisp variable. + pub org_link_parameters: &'g [&'g str], } pub const DEFAULT_TAB_WIDTH: IndentationLevel = 8; @@ -55,6 +60,7 @@ impl<'g, 's> GlobalSettings<'g, 's> { odd_levels_only: HeadlineLevelFilter::default(), footnote_section: "Footnotes", coderef_label_format: "(ref:%s)", + org_link_parameters: &ORG_LINK_PARAMETERS, } } } @@ -76,3 +82,29 @@ impl Default for HeadlineLevelFilter { HeadlineLevelFilter::OddEven } } + +const ORG_LINK_PARAMETERS: [&'static str; 23] = [ + "id", + "eww", + "rmail", + "mhe", + "irc", + "info", + "gnus", + "docview", + "bibtex", + "bbdb", + "w3m", + "doi", + "file+sys", + "file+emacs", + "shell", + "news", + "mailto", + "https", + "http", + "ftp", + "help", + "file", + "elisp", +];