html-pipeline-youtube 0.1.3 → 0.1.4
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/.travis.yml +2 -3
- data/lib/html/pipeline/youtube/version.rb +1 -1
- data/lib/html/pipeline/youtube/youtube_filter.rb +4 -4
- metadata +3 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5634a0bfc9d2bbe1aa2177caaf9079d50067db68
|
|
4
|
+
data.tar.gz: 1840aadf6d98a307c3b141306548fb63c71a80e2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8f78d0899aafbf717be0c49b94a677e1eec02458e98eb672f5cb7c706115298ec21bfe13e800e0d82157503cfafa51ba34f14632535744d384ec573624ad3985
|
|
7
|
+
data.tar.gz: b39e879e9cece43289b1a42019dd59b9e295e3c2e42575463db41e50fc9b317e743798f62bef677f0652ba080608477f1c48e8649dbe5303bce7bdff303f6bf5
|
data/.travis.yml
CHANGED
|
@@ -11,10 +11,9 @@ module HTML
|
|
|
11
11
|
# :video_wmode - string, sets iframe's wmode option
|
|
12
12
|
# :video_autoplay - boolean, whether video should autoplay
|
|
13
13
|
# :video_hide_related - boolean, whether shows related videos
|
|
14
|
-
regex = /(
|
|
14
|
+
regex = /(?<=^|\s|<div>|<br>)https?:\/\/(?:www.)?(?:youtube\.com\/(?:embed\/|watch\?(?:feature=player_embedded&)?v=)|youtu\.be\/)([A-Za-z0-9_-]*)[&?\w-]*/
|
|
15
15
|
@text.gsub(regex) do
|
|
16
|
-
youtube_id = $
|
|
17
|
-
close_tag = $1 if ["<br>", "<div>"].include? $1
|
|
16
|
+
youtube_id = $1
|
|
18
17
|
width = context[:video_width] || 420
|
|
19
18
|
height = context[:video_height] || 315
|
|
20
19
|
frameborder = context[:video_frameborder] || 0
|
|
@@ -28,7 +27,8 @@ module HTML
|
|
|
28
27
|
params << "rel=0" if hide_related
|
|
29
28
|
src += "?#{params.join '&'}" unless params.empty?
|
|
30
29
|
|
|
31
|
-
|
|
30
|
+
# Prefix with two "\n" for compatibility with markup such as Markdown:
|
|
31
|
+
%{\n\n<div class="video youtube"><iframe width="#{width}" height="#{height}" src="#{src}" frameborder="#{frameborder}" allowfullscreen></iframe></div>}
|
|
32
32
|
end
|
|
33
33
|
end
|
|
34
34
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: html-pipeline-youtube
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Stan Luo
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2017-05-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: html-pipeline
|
|
@@ -78,9 +78,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
78
78
|
version: '0'
|
|
79
79
|
requirements: []
|
|
80
80
|
rubyforge_project:
|
|
81
|
-
rubygems_version: 2.
|
|
81
|
+
rubygems_version: 2.5.1
|
|
82
82
|
signing_key:
|
|
83
83
|
specification_version: 4
|
|
84
84
|
summary: Youtube filter for html-pipeline
|
|
85
85
|
test_files: []
|
|
86
|
-
has_rdoc:
|