Skip to content

Fix list rendering in table cells #301

Description

@tetromino

If you have a rule attribute with a doc string containing a list:

{
   "foo": attr.string(default = "x", values = ["x", "y"], doc = """Blah blah blah

Possible values:
* `"x"` - sets foo to x
* `"y"` - sets foo to y
"""),
}

then Stardoc will misrender it in a cell of the rule attributes table, producing something terrible and ugly like

| Blah blah blah<br><br>Possible values: * `"x"` - sets foo to x * `"y"` - sets foo to y |

Example: bazelbuild/bazel-skylib#587

Instead, we want to transform Markdown lists into HTML - same as we already do for code blocks (see formatFencedCodeBlock in MarkdownUtil.java).

The desired output should be something like

| Blah blah blah<br><br>Possible values: <ul><li>`"x"` - sets foo to x</li> <li>`"y"` - sets foo to y</li></ul> |

See also https://stackoverflow.com/questions/19950648/how-to-write-lists-inside-a-markdown-table

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions