Skip to content

Commit 4d847cb

Browse files
pepinho24Iankodj
authored andcommitted
fix(notes): fix broken slugs in notes and alerts fixes #14
1 parent 46e4a47 commit 4d847cb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

_plugins/alert_generator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def createAlert(alertType, content)
2020
sub_string.each do |s|
2121
# puts("s - #{s} ; s1 - #{s[1]}; replaced - #{s[1].gsub(/(^>)/, "")}")
2222
block ="<blockquote class='#{alertType}'>" + @converter.convert(s[1].gsub(/(^>)/x, "")) + "</blockquote>"
23-
slugsInBlock = block.scan(/.*?(%7[Bb]%slug%20([\w-]+)%{2}7[Dd])/)
23+
slugsInBlock = block.scan(/.*?(%7[Bb]%slug%20([0-9a-zA-Z_\-\(\)\*\.\/\,\%\'\?\:]+)%{2}7[Dd])/)
2424
if slugsInBlock.count > 0
2525
slugsInBlock.each do |slug|
2626
targetPage = @site.pages.find {|p| p.data['slug'] == slug[1]}

0 commit comments

Comments
 (0)