WIP: Markdown helper for Kramdown
Closes #1401 (closed) "Follow-up from "WIP: GitLab 9.2 release post"
What
The code block below (def markdown s
) in custom_helpers.rb
, added by 40f82398:
def markdown(text)
Tilt['markdown'].new { text }.render
end
def markdown s
Kramdown::Document.new(s).to_html
end
Enabled the ability to add markdown kramdown to Yaml data files, then pull them into Haml files with = markdown(foo.bar)
. With only the block def markdown(text)
, there wasn't a way to do this (ref !6084 (diffs)).
This helper is gonna be helpful for other pages; e.g., if we want we can enable to /comparison/*
:
From @rspeicher (!5551 (diffs, comment 30331287)):
What? There's a helper directly above this one called
markdown
.(...)
You can just add another method with the same name. It's replacing the previous one, so now the old one's there for no reason.
I also don't understand what wasn't working with the old one -- I'll open an issue to address in another MR.
Let's figure out what we're gonna do about it ;)
cc/ @seanpackham @axil