Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [asciidoc-lang-dev] Markup for nested blocks
  • From: Sylvain Leroux <sylvain@xxxxxxxxxxx>
  • Date: Thu, 11 Mar 2021 10:49:03 +0100
  • Autocrypt: addr=sylvain@xxxxxxxxxxx; keydata= xsFNBFdFUf4BEACl0a/nxBGmY4eqGLMYQTVTaUt+Z7SXkaYiiMx00suDDJpCsE3f6Qet4zaC 1EBBseb0x/164kC92cc8ZV5NN00qOKWEkf05/JrVEFFq4le78l/9yO5GTE9ORnrOEqbYrFYf +3ArkXHnxFmR1SCRyFGKTtgE2nGqbKicQgjOYQFS4DfRVkEyPfKsr7/J1GUUTHu/sD7nnNik +7trfLwva9D6EetRUnd+H/AV6QVw3jhgR9klpKMo7+bXi35IZShnYAN+kvuAvoCQDjv1L2L5 XkOf9gGNLJAdEKbBcK0UiQ80RvO6Vr0FejpA0tmRGGIqB5m6WNxRxpeFhgK32l1+pInjGIP3 1to6xf0+pJWuWL5ZfQq8+8+4J+5ibX/klD5D6b78aNV/B/NTO+wE2B1Umw1JWthnKlTbKLCj t4IvAXsQCJWXi55pyz2S2m2vMd1ffHKPl59jIJzUXy2nM9sQhFTzLeKUZ0V6RBUF9lGDAWwh 3pR0OaIvQzuBEf1qEdLBsjMsI9SJdMY4VOKWMCuSMm+KlaF3jsEPkgu+GymUDCbvv2ZIGwwK kXQbs2gqpicPUKXwiszbgx43wiwpTLQ+6ZRlaoKlbVlHoCC/eO2fMvfasUOJZzLZSHOPPsOr xCtygLrSBx5hLdAA7syJv1GVGQaE8IfQPM7P+5QPHVhgQ/mJEQARAQABzSRTeWx2YWluIExl cm91eCA8c3lsdmFpbkBjaGljb3JlZS5mcj7CwYIEEwEIACwCGyMFCQlmAYAHCwkIBwMCAQYV CAIJCgsEFgIDAQIeAQIXgAUCV+WKiQIZAQAKCRCrWB8dH2HFIpzYD/9KVcvI3xAlR+Ahxlvl AnxzwT1ZIhRT1YPbX3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se.org/mailman/private/asciidoc-lang-dev/>
  • List-help: <mailto:asciidoc-lang-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://dev.eclipse.org/mailman/listinfo/asciidoc-lang-dev>, <mailto:asciidoc-lang-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://dev.eclipse.org/mailman/options/asciidoc-lang-dev>, <mailto:asciidoc-lang-dev-request@eclipse.org?subject=unsubscribe>
  • Openpgp: preference=signencrypt
  • User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0 Thunderbird/60.9.0

On 09/03/2021 12:54, Dan Allen wrote:> Lex wrote:
>> Agree with everything you say, except that it is not possible to do
>> nesting without varying length or other indication of grouping
>
> I was merely pointing out that a parser *could* be written that matches
> pairs without relying on the varying line length (using a recursive
> descent). But even if it could be done, it shouldn't be done for the
> other reason I stated.

I'm struggling with an edge case right now. According to the docs
(https://docs.asciidoctor.org/asciidoc/latest/blocks/#block-commonalities,
emphasis mine):
____
All blocks can accomodate zero or more lines of metadata stacked
directly *on top of the block*.
____


So, when a parser encounters some metadata before a delimiter, it should
(must?) assume this is the start of a new block. But consider the
following example:

====
a
[example]
====
b
====
c
====

Here `[example]\n====` could be seen as a an _opening_ delimiter.
However, because all delimiters have the same length, the current
implementation of asciidoctor consider it as a _closing_ delimiter
instead and the document is rendered as:

<informalexample>
  <simpara>a</simpara>
</informalexample>
<simpara>b</simpara>
<informalexample>
  <simpara>c</simpara>
</informalexample>



How could we disambiguate this situation in the specs?

* If we say nested blocks MUST have delimiters of different lengths, the
string `[example]` should be part of the first block's content. However,
as of today, it does not appear in the output document.
* If we say metadata unambiguously marks the start of a block, we should
render the above example using nested blocks, despite all the delimiters
having the same length.
* Or we could say: "content that could be understood as metadata is
forbidden before a block closing delimiter" :/



Ideas? Comments?


Regard,
- Sylvain Leroux

Attachment: signature.asc
Description: OpenPGP digital signature


Back to the top