New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Square bracket support closes #42 #43
Conversation
andymond
commented
May 20, 2018
•
edited
edited
- Change LINK_TEXT_REGEX constant to %r!(.*?)! in generator.rb
- Add nested bracket & escaped nested bracket links to page.md fixture
- Add tests for nested bracket link & escaped nested bracket link to generator_spec.rb
- All tests and builds in script/cibuild passing
…e.md fixture, all specs passing
Welcome! Congrats on your first pull request to Jekyll Relative Links. If you haven't already, please be sure to check out the contributing guidelines. |
@@ -7,7 +7,7 @@ class Generator < Jekyll::Generator | |||
# Use Jekyll's native relative_url filter | |||
include Jekyll::Filters::URLFilters | |||
|
|||
LINK_TEXT_REGEX = %r!([^\]]+)! | |||
LINK_TEXT_REGEX = %r!([^\]]+|.*)! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I'm reading this correctly, this is "any character other than ]
OR any character". Is there an advantage to that over just .*
or .*?
? It looks like this still allows us to support multiple links on the same line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does still support multiple links on the same line, I was finding that just .* was breaking multiple links on the same line but I just checked .*? and it looks like it works too! I can change the regex match to that, I think it's a little clearer.
Congrats on getting your first pull request to Jekyll Relative Links merged! Without amazing humans like you submitting pull requests, we couldn’t run this project. You rock! 🎉 |