Skip to content

Commit aab8193

Browse files
committed
Naive implementation
1 parent 064b38b commit aab8193

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

src/markd/renderers/html_renderer.cr

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ module Markd
5757
newline
5858
if entering
5959
tag("blockquote", attrs(node))
60+
if node.data.fetch("alert", nil)
61+
tag("div", {"class" => "alert alert-#{node.data["alert"]}"}) do
62+
tag("strong") do
63+
output(node.data["title"].as(String))
64+
end
65+
end
66+
end
6067
else
6168
tag("blockquote", end_tag: true)
6269
end

src/markd/rules/block_quote.cr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ module Markd::Rule
1111
# This is an alert
1212
node.data["alert"] = match[1]
1313
node.data["title"] = match[2].strip
14+
parser.advance_offset(parser.line.size, false)
1415
end
1516

1617
MatchValue::Container

0 commit comments

Comments
 (0)