Open peteryates opened 2 days ago
The markdown templates are repeating the front matter in the body.
I'm pretty certain this is because in config/initializers/markdown_renderer.rb we call erb_handler#call twice:
config/initializers/markdown_renderer.rb
erb_handler#call
front_matter = erb_handler.call(template, page_sections[:front_matter]) page_content = erb_handler.call(template, page_sections[:markdown])
Each time returns a string that's later eval'd, like this:
" @output_buffer.safe_append='\nFIXME: Teacher has already completed an induction\n'.freeze;\n@output_buffer"
So the output buffer is appended to twice, once for the front matter and once for the body.
It think we should forego erb in the front matter for now if there's no easy clean fix.
Refs #694
The markdown templates are repeating the front matter in the body.
I'm pretty certain this is because in
config/initializers/markdown_renderer.rb
we callerb_handler#call
twice:Each time returns a string that's later eval'd, like this:
So the output buffer is appended to twice, once for the front matter and once for the body.
It think we should forego erb in the front matter for now if there's no easy clean fix.
Refs #694