Earmark warning: Illegal attributes ignored in IAL

Why is it that when I run mix docs, I get this error

warning: ExDoc.Markdown.Earmark (warning) lib/key/hd/mnemonic_seed/wordlist.ex:39 Illegal attributes ["\"absurd\"", "8,", "found,"] ignored in IAL

for this function?

Seems like ExDoc.Markdown.Earmark doesn’t like atoms somehow…

1 Like

Seems like this has been an issue for a while:

One thing that stands out: both doctests and code-blocks use a four space indent, starting from the surrounding content. Your example only indents two spaces:

3 Likes

I’ve indented it further to 4, and the warning disappeared!

Thanks al2o3cr!

Will reindent, but that’s definitely not ideal…

One could discuss if IAL makes sense for ex_doc maybe you should discuss it with them, however the correct way to escape IAL is as follows

iex(9)> EarmarkParser.as_ast("a\n\\{:a, 1}")
{:ok, [{"p", [], ["a\n{:a, 1}"], %{}}], []}

I found that this error can also occur for some tuples in @doc code:

    Perform a license check.

    ## Arguments

    * The first argument is the result of the license check.
    * The second argument is {params, socket.assigns}

    ## Return

    * true for success
    * {:error, error_atom} for failure.

Only the line containing {:error, error_atom} generated a warning, and interestingly complaining about the two parts in reverse order (as they were for RooSoft). Adding back ticks around the tuple resolved the issue for me.