summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/lang-url.mkiv
diff options
context:
space:
mode:
authorTaco Hoekwater <taco@elvenkind.com>2008-06-12 10:42:53 +0000
committerTaco Hoekwater <taco@elvenkind.com>2008-06-12 10:42:53 +0000
commit0d01365d53c456d246da0ca1f0b3cd9868f02b35 (patch)
tree01a655c8028e17cfb371456b299c1848fe08c05b /Master/texmf-dist/tex/context/base/lang-url.mkiv
parent44f3714442da07fdfc36a7f2a8dcd5d4294c5d26 (diff)
ConTeXt release 2008.05.21
git-svn-id: svn://tug.org/texlive/trunk@8691 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/lang-url.mkiv')
-rw-r--r--Master/texmf-dist/tex/context/base/lang-url.mkiv64
1 files changed, 64 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/context/base/lang-url.mkiv b/Master/texmf-dist/tex/context/base/lang-url.mkiv
new file mode 100644
index 00000000000..7479fed6803
--- /dev/null
+++ b/Master/texmf-dist/tex/context/base/lang-url.mkiv
@@ -0,0 +1,64 @@
+%D \module
+%D [ file=lang-url,
+%D version=2008.01.22, % used to be lang-mis
+%D title=\CONTEXT\ Language Macros,
+%D subtitle=Language Options,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\registerctxluafile{lang-url}{1.001}
+
+\unprotect
+
+% \urlsplitmode is not (yet) supported (not that much needed)
+
+\newtoks\everyhyphenatedurl
+
+\appendtoks
+ \let\&\letterampersand
+ \let\#\letterhash
+ \let\~\lettertilde
+ \let\\\letterbackslash
+ \let\$\letterdollar
+ \let\^\letterhat
+ \let\_\letterunderscore
+ \let\{\letterleftbrace
+ \let\}\letterrightbrace
+ \let\|\letterbar
+ \let~=\lettertilde
+ \let|=\letterbar
+\to \everyhyphenatedurl
+
+\def\hyphenatedurlseparator{} % \periodcentered
+
+\def\dohyphenatedurlafter #1{\char#1\discretionary{}{\hyphenatedurlseparator}{}}%
+\def\dohyphenatedurlbefore#1{\discretionary{\hyphenatedurlseparator}{}{}\char#1\relax}%
+\def\dohyphenatedurlnormal#1{\char#1\relax}%
+
+\def\sethyphenatedurlnormal#1{\ctxlua{commands.hyphenatedurl.characters[\!!bs#1\!!es]=0}}
+\def\sethyphenatedurlbefore#1{\ctxlua{commands.hyphenatedurl.characters[\!!bs#1\!!es]=1}}
+\def\sethyphenatedurlafter #1{\ctxlua{commands.hyphenatedurl.characters[\!!bs#1\!!es]=2}}
+
+\chardef\hyphenatedurllefthyphenmin = 3
+\chardef\hyphenatedurlrighthyphenmin = 3
+
+\unexpanded \def\hyphenatedurl#1%
+ {\dontleavehmode
+ \begingroup
+ \the\everyhyphenatedurl
+ \let\n\dohyphenatedurlnormal
+ \let\b\dohyphenatedurlbefore
+ \let\a\dohyphenatedurlafter
+ \expanded{\ctxlua{commands.hyphenatedurl.action(
+ \!!bs\noexpand\detokenize{#1}\!!es,
+ \number\hyphenatedurllefthyphenmin,
+ \number\hyphenatedurlrighthyphenmin
+ )}}%
+ \endgroup}
+
+\protect \endinput