dtext_rb 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/dtext_rb.gemspec +3 -3
- data/ext/dtext/dtext.c +3379 -4708
- data/ext/dtext/dtext.rl +10 -0
- data/test/dtext_test.rb +4 -0
- data/test/test_forum_posts.rb +2 -2
- data/test/test_wiki_pages.rb +2 -2
- metadata +2 -2
data/ext/dtext/dtext.rl
CHANGED
@@ -148,6 +148,16 @@ aliased_expand = '[expand=' (nonbracket+ >mark_a1 %mark_a2) ']';
|
|
148
148
|
|
149
149
|
list_item = '*'+ >mark_a1 %mark_a2 ws+ nonnewline+ >mark_b1 %mark_b2;
|
150
150
|
|
151
|
+
textile_link_desc := |*
|
152
|
+
'":' (internal_url | url);
|
153
|
+
*|;
|
154
|
+
|
155
|
+
textile_link := |*
|
156
|
+
'"';
|
157
|
+
|
158
|
+
any;
|
159
|
+
*|;
|
160
|
+
|
151
161
|
inline := |*
|
152
162
|
post_id => {
|
153
163
|
append(sm, true, "<a href=\"/posts/");
|
data/test/dtext_test.rb
CHANGED
@@ -132,6 +132,10 @@ class DTextTest < Minitest::Test
|
|
132
132
|
assert_parse('<p><a href="http://test.com">test</a></p>', '"test":http://test.com')
|
133
133
|
end
|
134
134
|
|
135
|
+
def test_old_style_links_with_inline_tags
|
136
|
+
assert_parse('<p><a href="http://test.com"><em>test</em></a></p>', '"[i]test[/i]":http://test.com')
|
137
|
+
end
|
138
|
+
|
135
139
|
def test_old_style_links_with_special_entities
|
136
140
|
assert_parse('<p>"1" <a href="http://three.com">2 & 3</a></p>', '"1" "2 & 3":http://three.com')
|
137
141
|
end
|
data/test/test_forum_posts.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
Dir["/dev_exclusions/dtext_bench/forum_posts/*.txt"].slice(
|
1
|
+
Dir["/dev_exclusions/dtext_bench/forum_posts/*.txt"].slice(90, 10).each do |file|
|
2
2
|
input = File.read(file)
|
3
|
-
o1 = DTextRagel.parse(input).gsub(/\s+<\/p>/, "</p>")
|
3
|
+
o1 = DTextRagel.parse(input).gsub(/\s+<\/p>/, "</p>").gsub(/"/, "\"")
|
4
4
|
o2 = DTextRuby.parse(input).gsub(/\r/, "").gsub(/\s+<\/p>/, "</p>").gsub(/%3A/, ":")
|
5
5
|
if o1.size != o2.size
|
6
6
|
puts input
|
data/test/test_wiki_pages.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
Dir["/dev_exclusions/dtext_bench/wiki_pages/*.txt"].sort.slice(
|
1
|
+
Dir["/dev_exclusions/dtext_bench/wiki_pages/*.txt"].sort.slice(10, 10).each do |file|
|
2
2
|
input = File.read(file)
|
3
|
-
o1 = DTextRagel.parse(input.dup).gsub(/\s+<\/p>/, "</p>")
|
3
|
+
o1 = DTextRagel.parse(input.dup).gsub(/\s+<\/p>/, "</p>").gsub(/"/, "\"")
|
4
4
|
o2 = DTextRuby.parse(input.dup).gsub(/\r/, "").gsub(/\s+<\/p>/, "</p>")
|
5
5
|
if o1.size != o2.size
|
6
6
|
puts input
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dtext_rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- r888888888
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|