summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2020-01-15 12:12:32 -0500
committerGravatar GitHub <noreply@github.com>2020-01-15 12:12:32 -0500
commit026883de8a8c80a1dc5fa3e51a95e951db4b2b6a (patch)
treecf4b600a783fb5bc87f83b98ffaed589aecae145 /src
parent5cce43a484bdde0053820b8ae408bcba830b25ba (diff)
parenteb86dffeeec897d17905f3adff84e6acfd018330 (diff)
Merge pull request #136 from dredozubov/anchor-links
Same page link anchors
Diffstat (limited to 'src')
-rw-r--r--src/c/urweb.c4
-rw-r--r--src/settings.sml1
2 files changed, 5 insertions, 0 deletions
diff --git a/src/c/urweb.c b/src/c/urweb.c
index 8ffe7dd3..0db5fc80 100644
--- a/src/c/urweb.c
+++ b/src/c/urweb.c
@@ -4638,6 +4638,10 @@ uw_Basis_string uw_Basis_currentUrl(uw_context ctx) {
return ctx->current_url;
}
+uw_Basis_string uw_Basis_anchorUrl(uw_context ctx, uw_Basis_string s) {
+ return uw_Basis_strcat(ctx, uw_Basis_strcat(ctx, ctx->current_url, "#"), s);
+}
+
void uw_set_currentUrl(uw_context ctx, char *s) {
ctx->current_url = s;
}
diff --git a/src/settings.sml b/src/settings.sml
index c8cb049c..eeaf8145 100644
--- a/src/settings.sml
+++ b/src/settings.sml
@@ -325,6 +325,7 @@ val jsFuncsBase = basisM [("alert", "alert"),
("ord", "ord"),
("checkUrl", "checkUrl"),
+ ("anchorUrl", "anchorUrl"),
("bless", "bless"),
("blessData", "blessData"),
("currentUrl", "currentUrl"),