Skip to content

Tag backend produces unusable JSON tag file for unordered lists or description lists #72

@james-ball-qualcomm

Description

@james-ball-qualcomm

I'd like to tag and entire unordered list or description list but it won't work.

Here's an example of what I'd like to tag:

[[norm:fruit-color]]
Bananas::
Generally yellow in color
Apples::
Generally red in color

[#norm:Zca_misa_c]#MISA.C is set if the following extensions are selected:#

[[norm:Zca_misa_c_list]]
* Zca and not F
* Zca, Zcf and F (but not D) is specified (RV32 only)
* Zca, Zcf and Zcd if D is specified (RV32 only)
** this configuration excludes Zcmp, Zcmt
* Zca, Zcd if D is specified (RV64 only)
** this configuration excludes Zcmp, Zcmt

Unfortunately I get this in the tags JSON file for these tags:

    "norm:fruit-color": [
      [
        [
          "#<Asciidoctor::ListItem@73700 {list_context: :dlist, text: \"Bananas\", blocks: 0}>"
        ],
        "#<Asciidoctor::ListItem@73720 {list_context: :dlist, text: \"Generally yellow in color\", blocks: 0}>"
      ],
      [
        [
          "#<Asciidoctor::ListItem@73740 {list_context: :dlist, text: \"Apples\", blocks: 0}>"
        ],
        "#<Asciidoctor::ListItem@73760 {list_context: :dlist, text: \"Generally red in color\", blocks: 0}>"
      ]
    ],
    "norm:Zca_misa_c": "MISA.C is set if the following extensions are selected:",
    "norm:Zca_misa_c_list": [
      "#<Asciidoctor::ListItem@73780 {list_context: :ulist, text: \"Zca and not F\", blocks: 0}>",
      "#<Asciidoctor::ListItem@73800 {list_context: :ulist, text: \"Zca, Zcf and F (but not D) is specified (RV32 only)\", blocks: 0}>",
      "#<Asciidoctor::ListItem@73820 {list_context: :ulist, text: \"Zca, Zcf and Zcd if D is specified (RV32 only)\", blocks: 1}>",
      "#<Asciidoctor::ListItem@73840 {list_context: :ulist, text: \"Zca, Zcd if D is specified (RV64 only)\", blocks: 1}>"
    ],

This isn't usable in this form and is also missing the text in the nested unordered list (lines starting with **).

@Timmmm, can you enhance the tags backend to instead provide adoc-formatted text instead of an array of objects? So, instead have the tags look like:

    "norm:fruit-color": "Bananas::\nGenerally yellow in color\nApples::\nGenerally red in color",
    "norm:Zca_misa_c": "MISA.C is set if the following extensions are selected:",
    "norm:Zca_misa_c_list": "* Zca and not F\n* Zca, Zcf and F (but not D) is specified (RV32 only)\n* Zca, Zcf and Zcd if D is specified (RV32 only)\n** this configuration excludes Zcmp, Zcmt\nZca, Zcd if D is specified (RV64 only)\n** this configuration excludes Zcmp, Zcmt"

OR at the very least (but not particularly desirable) to create an error message an cause asciidoctor to exit with a non-zero status if it detects these cases?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions