jekyll-mentions 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/jekyll-mentions.rb +11 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b89fcfb1371b8e8a9ab22a97de0dfcb30008003e
|
4
|
+
data.tar.gz: f819872d3158adb4dd5a275711c937818945417c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34c89dbec393270f5a214ceafbe54666191b3c70b32b9ef2711b7e59512cb374318bd23e96b86663986fe25310dd2e8d389846afd55b7620604f4d9f9fbea2c9
|
7
|
+
data.tar.gz: 009ca11e78e441653a7d8883f6e679bf1174deb95eac451480d7bbc3083de0e652efddfabf9b8c161635184c41e90d0f793c07074c1765f5af755f10fcff9049
|
data/lib/jekyll-mentions.rb
CHANGED
@@ -4,13 +4,23 @@ require 'html/pipeline'
|
|
4
4
|
module Jekyll
|
5
5
|
class Mentions
|
6
6
|
GITHUB_DOT_COM = "https://github.com".freeze
|
7
|
+
BODY_START_TAG = "<body".freeze
|
8
|
+
|
7
9
|
|
8
10
|
InvalidJekyllMentionConfig = Class.new(Jekyll::Errors::FatalException)
|
9
11
|
|
10
12
|
class << self
|
11
13
|
def mentionify(doc)
|
14
|
+
return unless doc.output.include?("@")
|
12
15
|
src = mention_base(doc.site.config)
|
13
|
-
|
16
|
+
if doc.output.include? BODY_START_TAG
|
17
|
+
parsed_doc = Nokogiri::HTML::Document.parse(doc.output)
|
18
|
+
body = parsed_doc.at_css('body')
|
19
|
+
body.children = filter_with_mention(src).call(body.inner_html)[:output].to_s
|
20
|
+
doc.output = parsed_doc.to_html
|
21
|
+
else
|
22
|
+
doc.output = filter_with_mention(src).call(doc.output)[:output].to_s
|
23
|
+
end
|
14
24
|
end
|
15
25
|
|
16
26
|
# Public: Create or fetch the filter for the given {{src}} base URL.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-mentions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitHub, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|