jekyll-embed-urls 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jekyll/embed/content.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf83c997e61bc80c849cede54bbd5acbc396ea050625816c7bdca3bb04d3cca5
|
4
|
+
data.tar.gz: 33bc4f1c0f1279eb41df3e30c9d9c0e8d60177a1a47fa5be2b1d339641bf7e49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d55b3655e34c323628a22d31ebd53224eb23538e3e1f4c0caf2f2670bd67e70bd49adae7315d170642c274719feb3ef5d33bc11a88ec074f3e1d8b50d7f5b62
|
7
|
+
data.tar.gz: d362fdcb2bf28d64bec1bd08eceaac38fad91c70a3fccea16a6322ab87e3511b361560fba14fa8d4ae3b37e845a27bc32c68f3d650e7937c90f85e29003dda3b
|
data/lib/jekyll/embed/content.rb
CHANGED
@@ -5,17 +5,17 @@ require 'cgi'
|
|
5
5
|
module Jekyll
|
6
6
|
class Embed
|
7
7
|
class Content
|
8
|
-
URL_RE =
|
8
|
+
URL_RE = /(<p[^>]*>[\s\n]*(https?:\/\/[^<\s\n]+)[\s\n]*<\/p>)/m.freeze
|
9
9
|
|
10
10
|
class << self
|
11
11
|
# Find URLs on paragraphs. We do it after rendering because
|
12
12
|
# sometimes we use HTML instead of pure Markdown and this way we
|
13
13
|
# catch both.
|
14
14
|
def embed!(content)
|
15
|
-
|
16
|
-
embed = Jekyll::Embed.embed CGI.unescapeHTML(
|
15
|
+
content.scan(URL_RE) do |p, url|
|
16
|
+
embed = Jekyll::Embed.embed CGI.unescapeHTML(url)
|
17
17
|
|
18
|
-
content.sub!
|
18
|
+
content.sub! p, embed
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-embed-urls
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- f
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-04-
|
11
|
+
date: 2022-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|