Re: [NTG-context] newlines in return Lua string

2019-06-15 Thread Aditya Mahajan

On Sat, 15 Jun 2019, Hans van der Meer wrote:


From\ctxlua{tex.print(hvdm.myluacall("\xmlatt{#1}{argument}"))}
Lua returns a string containing newline characters '\n'.

In ConTeXt this returned string is printed as one line, the embedded newlines 
are not honoured.
I thought to replace with \crlf in this manner: string1 .. "\\crlf" .. string2 
but the returned \crlf are not executed as such.

How to force \crlf's in the executed return?


Hard to say without a minimal example, but how about:

\startluacode
context.startlines()
context(hvdm.myluacall("\xmlatt{#1}{argument}"))
context.stoplines()
\stopluacode

or

\startlines
\ctxlua{context(hvdm.myluacall("\xmlatt{#1}{argument}))}
\stoplines

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] newlines in return Lua string

2019-06-15 Thread Hans van der Meer
From\ctxlua{tex.print(hvdm.myluacall("\xmlatt{#1}{argument}"))}
Lua returns a string containing newline characters '\n'.

In ConTeXt this returned string is printed as one line, the embedded newlines 
are not honoured.
I thought to replace with \crlf in this manner: string1 .. "\\crlf" .. string2 
but the returned \crlf are not executed as such.

How to force \crlf's in the executed return?

dr. Hans van der Meer


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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___