aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2025-01-30 11:33:58 +0000
committerDaniel Eklöf <daniel@ekloef.se>2025-02-05 12:35:17 +0000
commit130b05f02baaebe533bb00cc2824ffb9902f11d3 (patch)
tree35b0014b5e2c60d7b2429b6edefb7c83f2c711e2
parenturl-mode+config: wip: add url.regex option (diff)
foot.ini+doc: add default value of url.regex
-rw-r--r--config.c1
-rw-r--r--doc/foot.ini.5.scd2
-rw-r--r--foot.ini3
3 files changed, 4 insertions, 2 deletions
diff --git a/config.c b/config.c
index dd4300e3..1f779724 100644
--- a/config.c
+++ b/config.c
@@ -1239,6 +1239,7 @@ parse_section_url(struct context *ctx)
regex_t preg;
int r = regcomp(&preg, regex, REG_EXTENDED);
+
if (r != 0) {
char err_buf[128];
regerror(r, &preg, err_buf, sizeof(err_buf));
diff --git a/doc/foot.ini.5.scd b/doc/foot.ini.5.scd
index ddf5ce84..a23e3977 100644
--- a/doc/foot.ini.5.scd
+++ b/doc/foot.ini.5.scd
@@ -786,7 +786,7 @@ xdgtoken=95ebdfe56e4f47ddb5bba9d7dc3a2c35
URL regex to use when auto-detecting URLs. The format is
"POSIX-Extended Regular Expressions".
- Default: _TODO_
+ Default: _([a-z][[:alnum:]-]+:(/{1,3}|[a-z0-9%])|www[:digit:]{0,3}[.])([^[:space:](){}<>]+|\(([^[:space:](){}<>]+|(\([^[:space:](){}<>]+\)))\*\)|\[([^]\[[:space:](){}<>]+|(\[[^]\[[:space:](){}<>]+\]))\*\])+(\(([^[:space:](){}<>]+|(\([^[:space:](){}<>]+\)))\*\)|\[([^]\[[:space:](){}<>]+|(\[[^]\[[:space:](){}<>]+\]))\*\]|[^]\[[:space:]`!(){};:'".,<>?«»“”‘’])_
# SECTION: cursor
diff --git a/foot.ini b/foot.ini
index ae0002d4..85f3c861 100644
--- a/foot.ini
+++ b/foot.ini
@@ -69,7 +69,8 @@
# launch=xdg-open ${url}
# label-letters=sadfjklewcmpgh
# osc8-underline=url-mode
-# regex=TODO
+# regex=([a-z][[:alnum:]-]+:(/{1,3}|[a-z0-9%])|www[:digit:]{0,3}[.])([^[:space:](){}<>]+|\(([^[:space:](){}<>]+|(\([^[:space:](){}<>]+\)))*\)|\[([^]\[[:space:](){}<>]+|(\[[^]\[[:space:](){}<>]+\]))*\])+(\(([^[:space:](){}<>]+|(\([^[:space:](){}<>]+\)))*\)|\[([^]\[[:space:](){}<>]+|(\[[^]\[[:space:](){}<>]+\]))*\]|[^]\[[:space:]`!(){};:'".,<>?«»“”‘’])
+
[cursor]