Skip to content

Commit

Permalink
refactor: Rename #element argument
Browse files Browse the repository at this point in the history
  • Loading branch information
stephannv committed Sep 13, 2024
1 parent 55b7ac5 commit 0e4c2a7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/blueprint/html/element_renderer.cr
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
module Blueprint::HTML::ElementRenderer
private def element(_tag_name : String | Symbol, **attributes, &) : Nil
private def element(tag_name : String | Symbol, **attributes, &) : Nil
@buffer << "<"
@buffer << _tag_name
@buffer << tag_name
append_attributes(attributes)
@buffer << ">"
capture_content { yield }
@buffer << "</"
@buffer << _tag_name
@buffer << tag_name
@buffer << ">"
end

private def element(_tag_name : String | Symbol, __content__ : String, **attributes) : Nil
private def element(tag_name : String | Symbol, __content__ : String, **attributes) : Nil
@buffer << "<"
@buffer << _tag_name
@buffer << tag_name
append_attributes(attributes)
@buffer << ">"
::HTML.escape(__content__, @buffer)
@buffer << "</"
@buffer << _tag_name
@buffer << tag_name
@buffer << ">"
end

private def void_element(_tag_name : String | Symbol, **attributes) : Nil
private def void_element(tag_name : String | Symbol, **attributes) : Nil
@buffer << "<"
@buffer << _tag_name
@buffer << tag_name
append_attributes(attributes)
@buffer << ">"
end
Expand Down

0 comments on commit 0e4c2a7

Please sign in to comment.