Quasi-quotations, again

OK, after I asked I suddenly remembered that I asked already once and Jan answered… apparently, it is only me who has a “strip leading space” fetish. Here is the question and Jan’s reply (from the old mailing list, June 12 2013):

‘Quoted’ in the first example does not (cannot?) contain line-breaks

Between | and |}, everything is allowed, including an unbounded number
of newlines.

In the second example, we have two lines, with significant white space
(how about white space at the end of the line?)
In the second example, the quoted material is two lines, each ending
in a newline

You’ve misunderstood this. The quasi quoter always gets the raw
material as it appears between | and |}. The only thing that is done
to it by read is to respect the encoding of the file and provide a list
of Unicode code points, regardless of the encoding in the file.

A Quasi quoter may do stripping of newlines, delete ^\s*|, etc, but
this is up to the quoter. It can do anything it likes with the quoted
material.

Note that the quoter may decide that it does not allow for newlines
(or set a maximum or have a newline escape, or …) and throw a
syntax error. To the user, that will simply be transparent.

I might write a parser that uses the following convention and share it:

foo(X) :-
    X = {|multiline||
         |This is supposed to be
         |a "string" over multiple lines.
         |
         |There will be no leading white space!
         |}.

While I am at it I might also try to do a “text” quasi quotation grammar that can embed Prolog variables.