-
Notifications
You must be signed in to change notification settings - Fork 12
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
Patching issue 29 #30
Conversation
@MaximeKjaer Do you have the time to take a quick look? |
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.
I think this looks solid
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.
Hi, sorry for the delayed response. Could you provide a reproduction of the input that lead to l
being nil? It Would be useful to have a test case for this.
lib/premonition/processor.rb
Outdated
@@ -52,7 +52,9 @@ def adder(content) | |||
def load_references(content) | |||
refs = ["\n"] | |||
content.each_line do |l| | |||
refs << l if l.strip!.match(/^\[.*\]:.*\".*\"$/i) | |||
unless l.nil? || l == 0 || (l.is_a? String) | |||
refs << l if l.to_s.strip!.match(/^\[.*\]:.*\".*\"$/i) |
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.
Nitpick: this line needs to be indented
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.
@RobbiNespu Could you provide what @MaximeKjaer asked for? I would also like to be able to reproduce this in some test cases.
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.
@MaximeKjaer @lazee sorry, did't notice there is review msg on this. I re-indent that line as require
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.
@RobbiNespu Great, but could you also provide an example of what caused this, so that we can add a test for it?
I got this today, but just adding a note:
And enabling 'premonition' as jekyll plugin in _config.yml
|
Ran in to this today as well. Any chance we can get this over the finish line, please? |
I will do some testing on this tonight. |
@iranzo @luispollo I'm having a hard time recreating the problem locally. I have tried with Jekyll 3.8.6, 3.9.0 and 4.2.0. Hints on Ruby version, Jekyll version and setup would be highly appreciated. This is the output I get from the example @iranzo sent. |
This is my setup:
|
I've thrown away too much time on this now, so I guess we will just merge it in. I'm not able to recreate this problem with Jekyll 3.9.0. I don't see any harm in merging this in. |
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.
Even though I'm not able to create I will allow it.
@RobbiNespu @luispollo 4.0.1 released |
using
to_s
method to returns string representation of an objectusing
unless l.nil? || l == 0 || (l.is_a? String) ... end
filter string is not null, zero value or not string beforeref <<
Submit as patch for #29