Taco Hoekwater wrote: > Hi (mostly for Hans), > > Is there a clean way to get around this problem: > > \useencoding[ffr] > \mainlanguage[fr] > \starttext > \hyphenatedurl{http://somewhere.to/go} > \stoptext > > It gives: > > ! Undefined control sequence. > <argument> \discretionarytoken > > because of the active : , but I am not sure what > is the best fix. > \expandafter\if\string#1 etc
\def\scanurl#1% {\advance\scratchcounter\plusone \ifx#1\blankspace \flushurl\splitanyway\normalspace \else\ifx#1\ % \flushurl\splitanyway\normalspace \else\ifx#1\space \flushurl\splitanyway\normalspace \else\ifx#1\~% \flushurl\splitbefore\~% \else\ifx#1\#% \flushurl\splitbefore\#% \else\ifx#1\&% \flushurl\splitbefore\&% \else\ifx#1\%% \flushurl\splitbefore\%% \else\ifx#1\_% \flushurl\splitbefore\_% \else\if\noexpand#1\relax #1% \else\ifnum\catcode`#1=8 \flushurl\splitbefore\_% \else\ifnum\catcode`#1=6 \flushurl\splitbefore\#% \else\ifnum\catcode`#1=4 \flushurl\splitbefore\&% \else\expandafter\if\string#1\lettertilde \flushurl\splitbefore\~% \else\expandafter\if\string#1\letterpercent \flushurl\splitbefore\%% \else\expandafter\if\string#1\letterunderscore \flushurl\splitbefore\_% \else\expandafter\if\string#1\letterquestionmark \flushurl\splitafter\letterquestionmark \else\expandafter\if\string#1\letterat \flushurl\splitafter\letterat \else\expandafter\if\string#1\letterslash \edef\savedurl{\savedurl\letterslash}% \else\expandafter\if\string#1+% \flushurl\splitafter+% \else\expandafter\if\string#1:% \flushurl\splitafter:% \else\expandafter\if\string#1.% \flushurl\splitafter.% \else\expandafter\if\string#1(% \flushurl\splitbefore(% \else\expandafter\if\string#1)% \flushurl\splitafter)% \else \ifx\savedurl\empty\else \splitbefore\savedurl \let\savedurl\empty \fi \ifcase\urlhyphenmethod \string#1% \else \ifnum\scratchcounter>\plusthree % so, \http: will not break \edef\savedurl{\string#1}% \else \string#1% \fi \fi \fi\fi\fi\fi\fi\fi\fi\fi \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl ----------------------------------------------------------------- _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context