Jeff King [off-list ref] writes:
On Wed, Jan 20, 2016 at 09:21:37AM -0800, Matt Kraai wrote:
quoted
From: Matthew Kraai <redacted>
asciidoctor does not remove backslashes used to escape curly brackets from
the HTML output if the contents of the curly brackets are empty or contain
at least a <, -, or space. asciidoc does not require the backslashes in
these cases, so just remove them.
I think these backslashes may have been necessary in older versions of
asciidoc, but I don't recall the details. Looks like we did a similar
round of cleanups already in 4538a88256, so this is probably safe (and I
verified with asciidoc 8.6.9 that the generated output is the same).
quoted
-'<refname>@\{<date>\}', e.g. 'master@\{yesterday\}', 'HEAD@\{5 minutes ago\}'::
+'<refname>@{<date>}', e.g. 'master@\{yesterday\}', 'HEAD@{5 minutes ago}'::
I see you didn't tweak the middle one here, because it _does_ look like
an attribute. Does asciidoctor actually remove the backslashes there?
A more important question is if it works without the backslashes.
If not-too-stale versions of asciidoc everybody uses these days are
all OK without braces quoted with backslashes, and if the same holds
true for asciidoctor, then we would want consistency here.
On the other hand, if this line must be spelled like the above to
please asciidoctor, i.e. the first and the last must not have
backslashes and the second must have backslashes, I'd have to say
we have a bigger problem. Perhaps asciidoctor needs to be fixed
until normal people like we can rely on it.
On Wed, Jan 20, 2016 at 12:28:53PM -0800, Junio C Hamano wrote:
quoted
quoted
-'<refname>@\{<date>\}', e.g. 'master@\{yesterday\}', 'HEAD@\{5 minutes ago\}'::
+'<refname>@{<date>}', e.g. 'master@\{yesterday\}', 'HEAD@{5 minutes ago}'::
I see you didn't tweak the middle one here, because it _does_ look like
an attribute. Does asciidoctor actually remove the backslashes there?
A more important question is if it works without the backslashes.
If not-too-stale versions of asciidoc everybody uses these days are
all OK without braces quoted with backslashes, and if the same holds
true for asciidoctor, then we would want consistency here.
The answer to that is implied in the original commit message; no, it
does not work, because it is syntactically an asciidoc attribute.
On the other hand, if this line must be spelled like the above to
please asciidoctor, i.e. the first and the last must not have
backslashes and the second must have backslashes, I'd have to say
we have a bigger problem. Perhaps asciidoctor needs to be fixed
until normal people like we can rely on it.
Yeah, that is the "insane" part I mentioned. It _does_ make sense
syntactically ("-1" cannot possibly be an attribute name, so it does not
parse as one), but I do not like the degree to which writers must know
all of the arcane syntax rules (and cannot rely on something simple like
"{ is special, so I must escape it, and over-escaping is not a
problem").
-Peff
On Wed, Jan 20, 2016 at 03:34:30PM -0500, Jeff King wrote:
On Wed, Jan 20, 2016 at 12:28:53PM -0800, Junio C Hamano wrote:
quoted
On the other hand, if this line must be spelled like the above to
please asciidoctor, i.e. the first and the last must not have
backslashes and the second must have backslashes, I'd have to say
we have a bigger problem. Perhaps asciidoctor needs to be fixed
until normal people like we can rely on it.
Yeah, that is the "insane" part I mentioned. It _does_ make sense
syntactically ("-1" cannot possibly be an attribute name, so it does not
parse as one), but I do not like the degree to which writers must know
all of the arcane syntax rules (and cannot rely on something simple like
"{ is special, so I must escape it, and over-escaping is not a
problem").
The underlying issue is that both AsciiDoc and Asciidoctor use regexps
to parse their data, which we all know is a bad idea. Asciidoctor does
less forward looking because it's much faster, so it's a bit less
flexible with overescaping.
There are plans for Asciidoctor to move to a defined grammar at some
point, which should hopefully make things a bit less insane.
--
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | https://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187