Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

formatting CI badges fails #1

Closed
eahanson opened this issue Aug 25, 2022 · 4 comments
Closed

formatting CI badges fails #1

eahanson opened this issue Aug 25, 2022 · 4 comments

Comments

@eahanson
Copy link
Member

A readme.md file containing:

[![CI](https://github.com/synchronal/pages/actions/workflows/tests.yml/badge.svg "CI")](https://github.com/synchronal/pages/actions)

fails with:

** (FunctionClauseError) no function clause matching in MarkdownFormatter.Renderer.render/3    
    
    The following arguments were given to MarkdownFormatter.Renderer.render/3:
    
        # 1
        {"img", [{"src", "https://github.com/synchronal/pages/actions/workflows/tests.yml/badge.svg"}, {"alt", "CI"}, {"title", "CI"}], [], %{}}
    
        # 2
        Q.new([])
    
        # 3
        %MarkdownFormatter.Renderer.RenderState{class: nil, depth: 0, line_length: 120, parent: nil, prefix: ""}
    
    Attempted function clauses (showing 10 out of 29):
    
        defp render([], doc, _opts)
        defp render(contents, doc, %{class: class} = opts) when not (class == nil)
        defp render({"h1", attrs, contents, %{}}, doc, opts)
        defp render({"h2", attrs, contents, %{}}, doc, opts)
        defp render({"h3", attrs, contents, %{}}, doc, opts)
        defp render({"h4", attrs, contents, %{}}, doc, opts)
        defp render({"h5", attrs, contents, %{}}, doc, opts)
        defp render({"h6", attrs, contents, %{}}, doc, opts)
        defp render({"p", [], contents, %{}}, doc, opts)
        defp render({"blockquote", [], contents, %{}}, doc, opts)
        ...
        (19 clauses not shown)
    
    lib/markdown_formatter/renderer.ex:88: MarkdownFormatter.Renderer.render/3
    lib/markdown_formatter/renderer.ex:168: MarkdownFormatter.Renderer.render/3
    lib/markdown_formatter/renderer.ex:130: MarkdownFormatter.Renderer.render/3
    lib/markdown_formatter/renderer.ex:169: MarkdownFormatter.Renderer.render/3
    lib/markdown_formatter/renderer.ex:115: MarkdownFormatter.Renderer.render/3
    lib/markdown_formatter/renderer.ex:169: MarkdownFormatter.Renderer.render/3
    lib/markdown_formatter/renderer.ex:81: MarkdownFormatter.Renderer.to_markdown/2
    (mix 1.13.4) lib/mix/tasks/format.ex:564: Mix.Tasks.Format.format_file/2
@gaggle
Copy link

gaggle commented May 16, 2023

I seem to be getting this when using the collapsible syntax (<detail></detail>) and references ([foo]: https://example.com]) too.

@sax
Copy link
Member

sax commented May 16, 2023

Oof. For some reason I never saw this issue.

Fixing the original issue is trivial; I just shipped 04b1f49 to deal with it.

Collapsible... probably will be fine. References, though. That... hm. I'm going to open separate issues to track those.

@sax
Copy link
Member

sax commented May 16, 2023

Just added #2 for collapsible and #3 to track reference links. @gaggle I'm going to try to knock out collapsible this morning, but will have to come back to references after work, or before work on another day.

@sax
Copy link
Member

sax commented May 16, 2023

This original issue should be fixed in v0.6.0. Let me know if you continue to have issues, and for new unhandled syntax feel free to open new issues!

@sax sax closed this as completed May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants