This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: xml literals
On 06/13/2017 02:15 AM, Damien MATTEI wrote:
hello,
is there a way in HTML literal to make the code more human readable,
by inserting CR between two literals or /and to indent the code, ican not find a way in the doc
to insert characters between literals or doing it , if it's not possible i suppose it is not trivial to do it
as the method toString should be overwrite .
It does not appear to be documented, but XML literals can include the same
'special-escape' forms used in String template literals and named literals:
https://www.gnu.org/software/kawa/String-literals.html#meta-special-escape
I.e. use &- to include a newline in the literal, but not the the HTML text.
Use &| to add ignored initial indentation:
(write #<abc>123&-
&|456</>)
=> #<abc>123456</abc>
Note: There is a bug so you can't type (just) the following into the REPL:
#<abc>123&-
&|456</>
That should be an easy fix.
--
--Per Bothner
per@bothner.com http://per.bothner.com/