Files
growstuff/app/helpers/posts_helper.rb
Daniel O'Connor 49284eb169 Fix haml preview (#3610)
* HAML

* rewrite

* Fix specs - but likely still wrong

* Return temple

* Trailing line

* Fix specs

* This was rearranged, apparently.

* Fix tests

* Retain escaping

* Fix specs

* Rubocop

* Attempt to fix rendering

* Fix output

* Move away from filter

* Move away from filter

* Fix spec

* Fix specs

* Fix structure to avoid nested paragraph tags
2024-02-04 15:08:18 +10:30

8 lines
162 B
Ruby

# frozen_string_literal: true
module PostsHelper
def post_stripped_tags(post, length: 300)
truncate(strip_tags(markdownify(post.body)), length:)
end
end