Skip to content

Instantly share code, notes, and snippets.

@skalee
Last active April 9, 2019 22:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skalee/69f868601aa1cb36aa5a79f7aa939fc3 to your computer and use it in GitHub Desktop.
Save skalee/69f868601aa1cb36aa5a79f7aa939fc3 to your computer and use it in GitHub Desktop.
Asciidoctor's "warnings about indexing" bug

Probably a bug

About this list

  1. This list has many items, which are split across several sections.

  2. List items in document include index number. That is, they are formatted like:

    1. This list has many items, which are split across several sections.

    not like:

    . This list has many items, which are split across several sections.

Why it is split?

  1. There are use cases in which starting from higher number is advocated.

  2. For example, when many lists (from AsciiDoctor’s point of view) make sense as a whole (from reader’s point of view).

  3. I mean, software installation procedure could be organized in sections like: "Hardware requirements", "Software prerequisites", "Where to download from", "Compiling C++ sources", etc.

  4. This bug report is also kinda valid use case.

It renders correctly

  1. Actually, this list is rendered correctly.

  2. AsciiDoc supports [start=n] annotation which allows to continue list from some higher number.

  3. And yes, this technique is used in this very document.

So, what’s wrong with it?

  1. Warnings!

  2. It says:

    asciidoctor: WARNING: Wrong.adoc: line 21: list item index: expected 1, got 3
    asciidoctor: WARNING: Wrong.adoc: line 22: list item index: expected 2, got 4
    asciidoctor: WARNING: Wrong.adoc: line 23: list item index: expected 3, got 5
    asciidoctor: WARNING: Wrong.adoc: line 24: list item index: expected 4, got 6
    asciidoctor: WARNING: Wrong.adoc: line 29: list item index: expected 1, got 7
    asciidoctor: WARNING: Wrong.adoc: line 30: list item index: expected 2, got 8
    asciidoctor: WARNING: Wrong.adoc: line 31: list item index: expected 3, got 9
    asciidoctor: WARNING: Wrong.adoc: line 36: list item index: expected 1, got 10
    asciidoctor: WARNING: Wrong.adoc: line 37: list item index: expected 2, got 11
    asciidoctor: WARNING: Wrong.adoc: line 52: list item index: expected 3, got 12
    asciidoctor: WARNING: Wrong.adoc: line 57: list item index: expected 1, got 13
  3. Which is definitely incorrect.

Are you up to date?

  1. Yes, asciidoctor --version prints following:

    Asciidoctor 2.0.6 [https://asciidoctor.org]
    Runtime Environment (ruby 2.6.1p33 (2019-01-30 revision 66950) [x86_64-darwin17]) (lc:UTF-8 fs:UTF-8 in:UTF-8 ex:UTF-8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment