Skip to content

Commit

Permalink
render img AST
Browse files Browse the repository at this point in the history
  • Loading branch information
mayel committed Dec 27, 2024
1 parent 7128381 commit 857e316
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/ex_doc/doc_ast.ex
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,12 @@ defmodule ExDoc.DocAST do
fun.(ast, result)
end

# @void_elements ~W(area base br col command embed hr img input keygen link
# meta param source track wbr)a
def to_markdown_string({:img, attrs, _inner, _meta} = ast, fun) do
result = "![#{attrs[:alt]}](#{attrs[:src]} \"#{attrs[:title]}\")"
fun.(ast, result)
end

# ignoring these: area base col command embed input keygen link meta param source track wbr
def to_markdown_string({tag, _attrs, _inner, _meta} = ast, fun) when tag in @void_elements do
result = ""
fun.(ast, result)
Expand Down

0 comments on commit 857e316

Please sign in to comment.