Skip to content

Bug: unbalanced <li> tag emitted in synopsis #2108

Closed
@adamwight

Description

@adamwight

While consuming ex_doc epub output and running through a strict linter, I discovered that ex_doc is emitting some bad HTML. This task concerns the broken tags produced by the ExDoc.Formatter.HTML.Templates.synopsis/1 function.

Given minimal .ex input as follows,

defmodule ImbalanceTest do
  @doc """
  ## Options

  - one

  - two
  """
  def nonsense do
  end
end

The low-level method gets called like this,

iex> ExDoc.Formatter.HTML.Templates.synopsis("<h2>Options</h2><ul><li><p>one</p></li><li><p>two</p></li></ul>")
"<h2>Options</h2><ul><li><p>one</p>"

The <p> between list items seems to be key to triggering this bug.

Metadata

Metadata

Assignees

No one assigned

    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