File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,10 +49,10 @@ def inline_formatting(input)
4949 @re_help . rewrite_links input do |link , defi |
5050 # We don't add a description for images in links, because its
5151 # empty value forces the image to be inlined.
52- defi ||= link unless link =~ @re_help . org_image_file_regexp
52+ defi ||= link unless RegexpHelper . image_file . match ( link )
5353 link = link . gsub ( / / , "%%20" )
5454
55- if defi =~ @re_help . org_image_file_regexp
55+ if RegexpHelper . image_file . match ( defi )
5656 ""
5757 elsif defi
5858 "[#{ defi } ](#{ link } )"
Original file line number Diff line number Diff line change @@ -170,10 +170,6 @@ def org_emphasis_regexp
170170 "(?=#{ post_emphasis } )" )
171171 end
172172
173- def org_image_file_regexp
174- /\. (gif|jpe?g|webp|p(?:bm|gm|n[gm]|pm)|svgz?|tiff?|x[bp]m)/i
175- end
176-
177173 private
178174
179175 def pre_emphasis_regexp
Original file line number Diff line number Diff line change @@ -61,10 +61,10 @@ def inline_formatting(input)
6161
6262 # We don't add a description for images in links, because its
6363 # empty value forces the image to be inlined.
64- defi ||= link unless link =~ @re_help . org_image_file_regexp
64+ defi ||= link unless RegexpHelper . image_file . match ( link )
6565 link = link . gsub ( / / , "%%20" )
6666
67- if defi =~ @re_help . org_image_file_regexp
67+ if RegexpHelper . image_file . match ( defi )
6868 defi = "!#{ defi } (#{ defi } )!"
6969 elsif defi
7070 defi = "\" #{ defi } \" "
You can’t perform that action at this time.
0 commit comments