Skip to content

Commit 8ec25ae

Browse files
committed
Remove org_image_file_regexp
1 parent 620dd37 commit 8ec25ae

3 files changed

Lines changed: 4 additions & 8 deletions

File tree

lib/org-ruby/markdown_output_buffer.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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
"![#{defi}](#{defi})"
5757
elsif defi
5858
"[#{defi}](#{link})"

lib/org-ruby/regexp_helper.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff 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

lib/org-ruby/textile_output_buffer.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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}\""

0 commit comments

Comments
 (0)