This commit is contained in:
2025-11-07 13:34:32 -08:00
commit 1e8c5a972b
436 changed files with 11000 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
module PagesHelper
def word_count(content)
return if content.blank?
pluralize number_with_delimiter(content.split.size), "word"
end
def page_title(leaf, book)
[ leaf.title, book.title, book.author ].reject(&:blank?).to_sentence(two_words_connector: " · ", words_connector: " · ", last_word_connector: " · ")
end
def sanitize_content(content)
sanitize content, scrubber: HtmlScrubber.new
end
end