Skip to content

Commit

Permalink
simplify regex for relative path of assets
Browse files Browse the repository at this point in the history
  • Loading branch information
fauno committed Nov 28, 2017
1 parent 7b6e7fb commit a677d0a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/jekyll-pandoc-multiple-formats/pandoc_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ def yaml_metadata
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 = ""
Expand All @@ -148,7 +148,7 @@ def content
# 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
Expand Down

0 comments on commit a677d0a

Please sign in to comment.