Wapp

wapp-trim - ERROR: extra characters after close-quote
Login

wapp-trim - ERROR: extra characters after close-quote

(1) By Luis (liban20) on 2024-05-02 14:44:02 [source]

Hi,

First of all, thank you very much for this project and for SQLite as well!

I'm using Wapp version 796aa7e55a and Tcl 8.6.13. The simplified code is of a foreach loop.

foreach descr $test {
    wapp-trim "
      <td>%html($descr)</td>
    "
}
For a test case, let's suppose:
set descr "\"changed\": false"

This breaks wapp. The error returned is:

ERROR: extra characters after close-quote.

I was expecting that the quotes would be escaped as said in:

""" wapp-subst TEXT This command appends text to the end of reply to an HTTP request. The TEXT argument should be enclosed in {...} to prevent accidental substitutions. The "wapp-subst" command itself will do all necessary backslash substitutions. Command and variable substitutions occur within "%html(...)", "%url(...)", "%qp(...)", "%string(...)", and "%unsafe(...)". The substitutions are escaped (except in the case of "%unsafe(...)") so that the result is safe for inclusion within the body of an HTML document, a URL, a query parameter, or a javascript or JSON string literal, respectively. """

All the best,

Luís