We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 08acb7f + 2ee62f4 commit 7f79ff1Copy full SHA for 7f79ff1
.gitignore
@@ -1,3 +1,4 @@
1
2
.DS_Store
3
/.vs
4
+/.history
_plugins/custom_alerts.rb
@@ -0,0 +1,23 @@
+module Jekyll
+ class AlertsConverter < Converter
+
+ def matches(ext)
5
+ ext =~ /^\.md|\.markdown$/i
6
+ end
7
8
+ def output_ext(ext)
9
+ ".html"
10
11
12
+ def convert(content)
13
+ content.gsub(/^> \[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]\s*(.*)/i) do
14
+ type = $1.downcase
15
+ text = $2.strip.gsub(/^>\s*/, "")
16
+ <<~HTML
17
+ <div class="blockquote-#{type}"></div>
18
+ <blockquote>#{text}</blockquote>
19
+ HTML
20
21
22
23
+end
0 commit comments