Skip to content

Commit

Permalink
Merge pull request #64 from Legytma/fix-regex-fragment
Browse files Browse the repository at this point in the history
fix(generator): links with title without fragment
  • Loading branch information
benbalter authored Jul 6, 2020
2 parents 8fcee0b + 56d8e65 commit ee58af1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/jekyll-relative-links/generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Generator < Jekyll::Generator
include Jekyll::Filters::URLFilters

LINK_TEXT_REGEX = %r!(.*?)!.freeze
FRAGMENT_REGEX = %r!(#.+?)?!.freeze
FRAGMENT_REGEX = %r!(#.+?|)?!.freeze
TITLE_REGEX = %r{(\s+"(?:\\"|[^"])*(?<!\\)"|\s+"(?:\\'|[^'])*(?<!\\)')?}.freeze
FRAG_AND_TITLE_REGEX = %r!#{FRAGMENT_REGEX}#{TITLE_REGEX}!.freeze
INLINE_LINK_REGEX = %r!\[#{LINK_TEXT_REGEX}\]\(([^\)]+?)#{FRAG_AND_TITLE_REGEX}\)!.freeze
Expand Down

0 comments on commit ee58af1

Please sign in to comment.