trac-wiki 0.3.19 → 0.3.20
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 +7 -0
- data/Gemfile.lock +2 -2
- data/lib/trac-wiki/parser.rb +3 -3
- data/lib/trac-wiki/tree.rb +4 -3
- data/lib/trac-wiki/version.rb +1 -1
- data/test/parser_test.rb +7 -0
- metadata +13 -18
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 9082403f6f5ffdf60c8ea8e3c6785e5944292826
|
4
|
+
data.tar.gz: 13881be54dd10ad85d65928bd07258bd4905cf13
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 56fb3457869356cb1ea30baa0044504411bac301d319db3ca638d6819e4f594d6abaa464370098a0abebb790bf20f21ce30db6c598c30fbc1dc3bb85c18ecbd7
|
7
|
+
data.tar.gz: 4b19c77f25ac1d16ebcfbdc48549806acee97ece6c38ea526fbd37b0b5522d1d6f2b5bd185582a68aad8865927180769e5f5e74957ba096d1fb496f831566906
|
data/Gemfile.lock
CHANGED
data/lib/trac-wiki/parser.rb
CHANGED
@@ -685,9 +685,9 @@ module TracWiki
|
|
685
685
|
def _parse_attrs_to_hash(str)
|
686
686
|
ret = {}
|
687
687
|
@env.atput('lineno', @line_no);
|
688
|
-
while str =~ /\A\s*(
|
689
|
-
str =~ /\A\s*(
|
690
|
-
str =~ /\A\s*(
|
688
|
+
while str =~ /\A\s*([-\w]+)\s*=\s*'([^>']*)'/ ||
|
689
|
+
str =~ /\A\s*([-\w]+)\s*=\s*"([^>"]*)"/ ||
|
690
|
+
str =~ /\A\s*([-\w]+)\s*=\s*(\S*)/
|
691
691
|
ret[$1] = @env.expand($2)
|
692
692
|
str = $'
|
693
693
|
end
|
data/lib/trac-wiki/tree.rb
CHANGED
@@ -163,6 +163,7 @@ module TracWiki
|
|
163
163
|
:_all => [:class, :title, :id],
|
164
164
|
}
|
165
165
|
|
166
|
+
ATTRIBUTE_DATA_REX = /\Adata-[-a-z]+\Z/i
|
166
167
|
ATTRIBUTE_STYLE_REX = /\A( text-align:(center|right|left) |
|
167
168
|
margin: \d+(px|em)? |
|
168
169
|
;
|
@@ -172,11 +173,11 @@ module TracWiki
|
|
172
173
|
ret = ['']
|
173
174
|
tag_attrs = ATTRIBUTES_ALLOWED[tag] || []
|
174
175
|
attrs.each_pair do |k,v|
|
176
|
+
#print "a: #{k} #{v}\n"
|
175
177
|
next if v.nil?
|
176
178
|
k_sym = k.to_sym
|
177
|
-
next if ! ( ATTRIBUTES_ALLOWED[:_all].include?(k_sym) || tag_attrs.include?(k_sym) )
|
178
|
-
next if
|
179
|
-
#print "style: #{v}\n" if k == :style
|
179
|
+
next if ! ( ATTRIBUTES_ALLOWED[:_all].include?(k_sym) || tag_attrs.include?(k_sym) || k =~ ATTRIBUTE_DATA_REX )
|
180
|
+
next if k_sym == :style && v !~ ATTRIBUTE_STYLE_REX
|
180
181
|
ret.push "#{TracWiki::Parser.escapeHTML(k.to_s)}=\"#{TracWiki::Parser.escapeHTML(v.to_s)}\""
|
181
182
|
end
|
182
183
|
return ret.sort.join(' ')
|
data/lib/trac-wiki/version.rb
CHANGED
data/test/parser_test.rb
CHANGED
@@ -1213,5 +1213,12 @@ eos
|
|
1213
1213
|
tc "<div class=\"AHOJ\">TEST</div>\n", "{{!set ahoj|AHOJ}}<div class=\"{{$ahoj}}\">TEST</div></p>\n", allow_html: true
|
1214
1214
|
tc "<div class=\"**AHOJ**\">TEST</div>\n", "{{!set ahoj|AHOJ}}<div class=\"**{{$ahoj}}**\">TEST</div></p>\n", allow_html: true
|
1215
1215
|
end
|
1216
|
+
it 'should parse data-* ' do
|
1217
|
+
tc "<div data-coffie=\"tea\">TEST</div>\n", "<div data-coffie=\"tea\">TEST</div>\n", allow_html: true
|
1218
|
+
tc "<div data-coffie-break=\"tea\">TEST</div>\n", "<div data-coffie-break=\"tea\">TEST</div>\n", allow_html: true
|
1219
|
+
tc "<div>TEST</div>\n", "<div data-coffie-break9=\"tea\">TEST</div>\n", allow_html: true
|
1220
|
+
|
1221
|
+
tc "<p><div data-coffie-break="tea">TEST</div></p>\n", "<div data-coffie-break=\"tea\">TEST</div>\n", allow_html: false
|
1222
|
+
end
|
1216
1223
|
end
|
1217
1224
|
# vim: tw=0
|
metadata
CHANGED
@@ -1,46 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trac-wiki
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
5
|
-
prerelease:
|
4
|
+
version: 0.3.20
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Vitas Stradal
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2014-
|
11
|
+
date: 2014-10-13 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: bacon
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rake
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">="
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ">="
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
description: TracWiki markup language render (http://trac.edgewall.org/wiki/WikiFormatting
|
@@ -53,7 +48,7 @@ extensions: []
|
|
53
48
|
extra_rdoc_files:
|
54
49
|
- README
|
55
50
|
files:
|
56
|
-
- .gitignore
|
51
|
+
- ".gitignore"
|
57
52
|
- Gemfile
|
58
53
|
- Gemfile.lock
|
59
54
|
- README
|
@@ -70,26 +65,26 @@ files:
|
|
70
65
|
homepage: http://github.com/vitstradal/trac-wiki
|
71
66
|
licenses:
|
72
67
|
- GPL-2
|
68
|
+
metadata: {}
|
73
69
|
post_install_message:
|
74
70
|
rdoc_options: []
|
75
71
|
require_paths:
|
76
72
|
- lib
|
77
73
|
required_ruby_version: !ruby/object:Gem::Requirement
|
78
|
-
none: false
|
79
74
|
requirements:
|
80
|
-
- -
|
75
|
+
- - ">="
|
81
76
|
- !ruby/object:Gem::Version
|
82
77
|
version: '0'
|
83
78
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
84
|
-
none: false
|
85
79
|
requirements:
|
86
|
-
- -
|
80
|
+
- - ">="
|
87
81
|
- !ruby/object:Gem::Version
|
88
82
|
version: '0'
|
89
83
|
requirements: []
|
90
84
|
rubyforge_project: trac-wiki
|
91
|
-
rubygems_version:
|
85
|
+
rubygems_version: 2.2.2
|
92
86
|
signing_key:
|
93
|
-
specification_version:
|
87
|
+
specification_version: 4
|
94
88
|
summary: Trac Wiki markup language
|
95
89
|
test_files: []
|
90
|
+
has_rdoc:
|