Skip to content
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

Merged
merged 7 commits into from May 21, 2018

Conversation

andymond
Copy link
Contributor

@andymond andymond commented May 20, 2018

  • 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

@welcome
Copy link

welcome bot commented May 20, 2018

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.

@andymond andymond changed the title Square bracket support Square bracket support closes #42 May 20, 2018
@@ -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!([^\]]+|.*)!
Copy link
Owner

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?

Copy link
Contributor Author

@andymond andymond May 21, 2018

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.

@benbalter benbalter merged commit adf9a6a into benbalter:master May 21, 2018
@welcome
Copy link

welcome bot commented May 21, 2018

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! 🎉

If you're interested in tackling another bug or feature, take a look at the open issues, especially those labeled help wanted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants