Skip to content

Commit 8396b0d

Browse files
committed
🐛 Fix bug in the emdash function.
#11
1 parent 262afb2 commit 8396b0d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/jekyll/typogrify.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def custom_caps(text)
149149
# @param [String] text input text
150150
# @return [String] input text with em dashes wrapped
151151
def emdash(text)
152-
text.gsub(/(\s| )—(?:mdash;|#8212;)?(\s| )/) { |str|
152+
text.gsub(/(\w|\s| )—(?:mdash;|#8212;)?(\w|\s| )/) { |str|
153153
$1 + '<span class="emdash">&mdash;</span>' + $2
154154
}.gsub(/(\w+)="(.*?)<span class="emdash">&mdash;<\/span>(.*?)"/, '\1="\2&mdash;\3"')
155155
end

0 commit comments

Comments
 (0)