-
Notifications
You must be signed in to change notification settings - Fork 30
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
Parse only content necessary to mentionify doc #59
Conversation
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.
LGTM.
lib/jekyll-mentions.rb
Outdated
@@ -8,24 +8,27 @@ class Mentions | |||
GITHUB_DOT_COM = "https://github.com".freeze | |||
BODY_START_TAG = "<body".freeze | |||
|
|||
OPENING_BODY_TAG_REGEX = %r!<body(.*)>\s*! |
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.
Same questions as jekyll/jemoji#74 (comment)... cross-posting theme here for ease of reference:
- Does the
.*
need to be non-greedy? (not sure which is more fault tolerant) - Does this need to be case insensitive to allow for
<BODY
tags? - Could we simplify/collapse the existing logic with
BODY_START_TAG
?
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.
14be2e2
to
aeffa1c
Compare
@jekyllbot: merge +minor |
Instead of having Nokogiri parse the entire HTML doc and then selectively apply the mentionify_filter to just the contents of the
<body>
tag, let's have Nokogiri parse just the<body>
tag descendants insteadThe mentionified markup is then inserted back into
doc.output
viaString#<<
Fixes #37 as well