Skip to content

Commit

Permalink
False render? predicate should return empty string (#563)
Browse files Browse the repository at this point in the history
  • Loading branch information
joeldrapper authored Apr 20, 2023
2 parents 8218340 + f60c905 commit 79d396a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.8.1] 2024-04-19

### Fixed

- Rendering a component with a false `render?` predicate should return an empty String rather than `nil`.

## [1.8.0] 2024-04-19

### Changed
Expand Down
2 changes: 1 addition & 1 deletion lib/phlex/sgml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def __final_call__(buffer = +"", context: Phlex::Context.new, view_context: nil,

block ||= @_content_block

return unless render?
return "" unless render?

around_template do
if block
Expand Down
2 changes: 1 addition & 1 deletion lib/phlex/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Phlex
VERSION = "1.8.0"
VERSION = "1.8.1"
end

0 comments on commit 79d396a

Please sign in to comment.