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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ec1da87cb376287956f8e42a3608a874ab260dff
4
- data.tar.gz: 09ea8fb4878d8948952aeff14b20d8dcfe1b8f40
3
+ metadata.gz: 5634a0bfc9d2bbe1aa2177caaf9079d50067db68
4
+ data.tar.gz: 1840aadf6d98a307c3b141306548fb63c71a80e2
5
5
  SHA512:
6
- metadata.gz: 47d1ec39c7fa80f8fbe19431a7aca3ff99e57b3a772a59376590ba04a4bfcad78b8539534755e988f53ccee9780cb8ac85484649cb40b1022a6104ab70447ca3
7
- data.tar.gz: 7799c1614cf57d3366ccb1d26a8e2428a70ab2be4e7d182e09f3a7be45467e3128f8ea1f8ae6d0912a0d3b2117febecac4314529d3c2a601c2033a6a59d16314
6
+ metadata.gz: 8f78d0899aafbf717be0c49b94a677e1eec02458e98eb672f5cb7c706115298ec21bfe13e800e0d82157503cfafa51ba34f14632535744d384ec573624ad3985
7
+ data.tar.gz: b39e879e9cece43289b1a42019dd59b9e295e3c2e42575463db41e50fc9b317e743798f62bef677f0652ba080608477f1c48e8649dbe5303bce7bdff303f6bf5
@@ -2,9 +2,8 @@ language: ruby
2
2
  sudo: false
3
3
  cache: bundler
4
4
  rvm:
5
- - 2.0
6
- - 2.1
7
- - 2.2
5
+ - 2.3.4
6
+ - 2.4.1
8
7
  - ruby-head
9
8
 
10
9
  notifications:
@@ -1,7 +1,7 @@
1
1
  module HTML
2
2
  class Pipeline
3
3
  module Youtube
4
- VERSION = '0.1.3'
4
+ VERSION = '0.1.4'
5
5
  end
6
6
  end
7
7
  end
@@ -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 = /(\s|^|<div>|<br>)(https?:\/\/)(www.)?(youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/watch\?feature=player_embedded&v=)([A-Za-z0-9_-]*)(\&\S+)?(\?\S+)?/
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 = $5
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
- %{#{close_tag}<div class="video youtube"><iframe width="#{width}" height="#{height}" src="#{src}" frameborder="#{frameborder}" allowfullscreen></iframe></div>}
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.3
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: 2016-06-07 00:00:00.000000000 Z
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.4.5.1
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: