From a677d0ab81ad65d2738926800e24de42fda6fe92 Mon Sep 17 00:00:00 2001 From: fauno <fauno@endefensadelsl.org> Date: Tue, 28 Nov 2017 15:48:38 -0300 Subject: [PATCH] simplify regex for relative path of assets --- lib/jekyll-pandoc-multiple-formats/pandoc_file.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/jekyll-pandoc-multiple-formats/pandoc_file.rb b/lib/jekyll-pandoc-multiple-formats/pandoc_file.rb index 6575d57..a124224 100644 --- a/lib/jekyll-pandoc-multiple-formats/pandoc_file.rb +++ b/lib/jekyll-pandoc-multiple-formats/pandoc_file.rb @@ -134,10 +134,10 @@ module Jekyll end def content - relative_re = /(!\[[^\]]*\]\()\/+/ + relative_re = /\(\/(.*)\)/ if single_post? # make all images relative to source dir - single_post.content.gsub(relative_re, '\1') + single_post.content.gsub(relative_re, '(\1)') else header_re = /^(#+.*\n*|.*\n[=-]+\n*)\Z/ bib_title = "" @@ -148,7 +148,7 @@ module Jekyll # leaving an empty chapter title to mark it as such content = post.content.gsub(header_re, '') # make all images relative to source dir - content = content.gsub(relative_re, '\1') + content = content.gsub(relative_re, '(\1)') content # we add the first bibliography title we can find in the end -- GitLab