diff --git a/CHANGELOG.md b/CHANGELOG.md index 96810fb5..2a58857c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ * Upgrade to Sinatra 3.1. (なつき) + * Tilt renderers (e.g. for Markdown, Haml, or Textile) are now configurable. + See #146 for details. + (Graham Ashton) + ## 0.15.0 (11 July 2023) * Upgrade to Sinatra 3. (Graham Ashton) diff --git a/lib/nesta/models/file_model.rb b/lib/nesta/models/file_model.rb index 2a1a87e7..489b86df 100644 --- a/lib/nesta/models/file_model.rb +++ b/lib/nesta/models/file_model.rb @@ -184,8 +184,12 @@ def add_p_tags_to_haml(text) def convert_to_html(format, scope, text) text = add_p_tags_to_haml(text) if @format == :haml - template = Tilt[format].new { text } + template = Tilt[format].new(renderer_config(@format)) { text } template.render(scope) end + + def renderer_config(format) + {} + end end end