From 0925eb53b4c94cff4843b6ed6e1c955d3ba1e2a0 Mon Sep 17 00:00:00 2001 From: Donald Lam Date: Sun, 15 Jan 2023 16:19:18 -0800 Subject: Rename quoted_rfc4180 to quoted_rfc, to avoid parser quirk Ledger's expression parser considers quoted_rfc4180 to be an amount (quantity 4180 of commodity "quoted_rfc"). Fixes #2007. --- doc/ledger3.texi | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'doc/ledger3.texi') diff --git a/doc/ledger3.texi b/doc/ledger3.texi index 9a538d99..db154873 100644 --- a/doc/ledger3.texi +++ b/doc/ledger3.texi @@ -8518,7 +8518,8 @@ Return the quantity of @var{value} for values that have a per-unit cost. @end defun @defun quoted expression -Surround @var{expression} with double-quotes. If expression contains a double-quote, it will be escaped with a backslash. +Surround @var{expression} with double quotes. If expression contains +a double quote, it will be escaped with a backslash. @smallexample @c command:EAD8AA7,with_input:3406FC1 $ ledger -f expr.dat --format "%(quoted(account)) %(quoted(amount))\n" reg @end smallexample @@ -8528,16 +8529,10 @@ $ ledger -f expr.dat --format "%(quoted(account)) %(quoted(amount))\n" reg @end smallexample @end defun -@c @defun quoted_rfc4180 expression -@c Surround @var{expression} with double-quotes, compliant with RFC 4180. If expression contains a double-quote, it will be represented with two double-quotes. -@c @smallexample @c command:EAD8AA7,with_input:3406FC1 -@c $ ledger -f expr.dat --format "%(quoted_rfc4180(account)) %(quoted_rfc4180(amount))\n" reg -@c @end smallexample -@c @smallexample @c output:EAD8AA7 -@c "Assets:Cash" "¤ -123,45" -@c "Expenses:Office Supplies" "¤ 123,45" -@c @end smallexample -@c @end defun +@defun quoted_rfc expression +Similar, except an embedded double quote would be escaped by +preceding it with another double quote, as prescribed by RFC 4180. +@end defun @defun round @value{FIXME:UNDOCUMENTED} -- cgit v1.2.3