martile 0.6.31 → 0.6.32
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
- checksums.yaml.gz.sig +0 -0
- data/lib/martile.rb +13 -5
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +2 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9f2923ea96d408824def1ebffedd006f6f5e1a60
|
|
4
|
+
data.tar.gz: 7c870c715b34ef66dce979418fad4198a443c2b7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7f5e18ef28c75eab6bac5d79f0f1d21c927d18c2b91ca9167c891b6c0b561c069b2693cc5d2d3aafe767339cd1be49a2ef4750ae095b251b49ef7ad7e5e3776b
|
|
7
|
+
data.tar.gz: fa842dfcc0e79e25c688c242cf9ffd407dfeffac7da600e458bd0b174ce0ab0900366712c426c0dae35e7469974dc1cecc7af88ee2424258bdd47f6835f9b323
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/lib/martile.rb
CHANGED
|
@@ -9,6 +9,8 @@ require 'rdiscount'
|
|
|
9
9
|
require 'kvx'
|
|
10
10
|
|
|
11
11
|
|
|
12
|
+
# minor feature:
|
|
13
|
+
# 3-Feb-2017 a video smartlink can now include options e.g. loop: true
|
|
12
14
|
# bug fix: 29-Jan-2017 2 or more code listings should now be parsed correctly
|
|
13
15
|
# feature: 24-Jun-2016 links containing a right parenthesis at the
|
|
14
16
|
# end are no longer cropped
|
|
@@ -545,21 +547,27 @@ class Martile
|
|
|
545
547
|
|
|
546
548
|
def videotag(s)
|
|
547
549
|
|
|
548
|
-
s.gsub(/\B!v\[\]\((https?:\/\/[^\)]+)\)\
|
|
549
|
-
|
|
550
|
+
s.gsub(/\B!v\[\]\((https?:\/\/[^\)]+)\)(\{[^\}]+\})?/) do |match|
|
|
551
|
+
|
|
550
552
|
files = ($1).split
|
|
553
|
+
attr = ($2)
|
|
554
|
+
|
|
555
|
+
h = attr ? attr.scan(/(\w+):\s+(\w+)/).to_h : {}
|
|
556
|
+
attributes = h.any? ? (' ' +
|
|
557
|
+
h.map {|k,v| "%s='%s'" % [k,v]}.join(' ')) : ''
|
|
551
558
|
|
|
552
|
-
|
|
559
|
+
h2 = {
|
|
553
560
|
/\.og[gv]$/ => 'ogg', /\.mp4$/ => 'mp4', /\.mov$/ => 'mov',
|
|
554
561
|
/\.webm$/ => 'webm'
|
|
555
562
|
}
|
|
556
563
|
|
|
557
564
|
sources = files.map do |file|
|
|
558
|
-
|
|
565
|
+
|
|
566
|
+
type = h2.detect{|k,v| file[k] }.last
|
|
559
567
|
" <source src='%s' type='video/%s'/>" % [file, type]
|
|
560
568
|
end
|
|
561
569
|
|
|
562
|
-
"<video controls='controls'>\n%s\n</video>" % [sources.join("\n")]
|
|
570
|
+
"<video controls='controls'%s>\n%s\n</video>" % [attributes, sources.join("\n")]
|
|
563
571
|
end
|
|
564
572
|
|
|
565
573
|
end
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
2(��v*���Q_�d��Tiޔf �֞)B�E��EY��qO�xD���K\�$�����7�-�d��!�`�.� �0��vZ� ��{�7�����U-F�B��jr
|
|
1
|
+
�==�HV��8x��-:�#m�ɐ�ԑ�(�p8
|
|
2
|
+
&�nQ �O�AȄ���B��P���"N��JQQJ�)���Jz��En��,w|��[*���˕����CEkt܌�39�(���,)�i�d�Y+�d��?���F�(�{|��G��o���x��W��^dq����|p�6X�tёZ-�ܿ�U�cͣ�,�Ɣ�r�����#Җ{���`L9IX(�$�G�QhFv��t_`&��3W-F��n�O&�V
|