Am 13.06.2011 um 14:19 schrieb luigi scarso:

> On Mon, Jun 13, 2011 at 2:12 PM, Steffen Wolfrum <[email protected]> 
> wrote:
>> Hi,
>> 
>> say I have arbitrary string of alphanumeric characters:
>> 
>> 
>> \starttext
>> 
>> \showframe
>> 
>> 9769387937933hhgiuiuziuziduzid93739837fhieuhifeuhfeiu39739837938398zfhfdkuhfiufhz398739837r98z379dihhfiu
>> 
>> \stoptext
> In mkiv make a lua script using gsub, i.e. something like
> s='9769387937933hhgiuiuziuziduzid93739837fhieuhifeuhfeiu39739837938398zfhfdkuhfiufhz398739837r98z379dihhfiu'
> s= string.gsub(s,'(.)',"%1\\hskip0sp")
> 
> 
> \starttext
> \startluacode
> s='9769387937933hhgiuiuziuziduzid93739837fhieuhifeuhfeiu39739837938398zfhfdkuhfiufhz398739837r98z379dihhfiu'
> s= string.gsub(s..s..s,'(.)',"%1\\hskip0sp")
> context(s)
> \stopluacode
> \stoptext



... ok, compared to this solution it is for sure easier to manually add \crlf  
:o))

The background are hundreds of URL's, which are part of regular text ... now 
transformed in a complicated but working beast:
\startbuffer[myurl:01]\catcode`\%=12 \catcode`\_=12 \catcode`\&=12 
\catcode`\#=12\setupalign[line,block,hanging]\useURL[test][http://www.lfd.m-v.de/dschutz/beschlue/ent49.html#nr.5][][http://www.lfd.m-v.de/dschutz/beschlue/ent49.html#nr.5]\from[test]\removeunwantedspaces\stopbuffer\getbuffer[myurl:01]

If I now again add your lines of luacode too, I go crazy :o)

Is there no handy little context command that could just be pasted before the 
string, like the following?
\useURL[...][...][][\ThisHelps 
9769387937933hhgiuiuziuziduzid93739837fhieuhifeuhfeiu39739837938398zfhfdkuhfiufhz398739837r98z379dihhfiu]


Steffen
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : [email protected] / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to