phrase_assembler 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/pa_proxies/pa_link_proxy.rb +19 -3
- metadata +3 -3
@@ -18,17 +18,33 @@ class PALinkProxy < PALangProxy
|
|
18
18
|
link_text = "{*#{link_text}*}"
|
19
19
|
end
|
20
20
|
|
21
|
+
add_attributes = ""
|
21
22
|
if p_options.options_hash[link_url.to_sym].is_a? Hash
|
22
23
|
identifier = "!link_url_#{link_url.object_id}"
|
23
24
|
add_options[identifier] = p_options.options_hash[link_url.to_sym][:href]
|
24
|
-
|
25
|
+
|
25
26
|
p_options.options_hash[link_url.to_sym].keys.sort{|a,b| a.to_s <=> b.to_s}.collect{|k|
|
26
27
|
add_attributes += " #{k} = '#{p_options.options_hash[link_url.to_sym][k]}'" if k != :href
|
27
28
|
}
|
28
|
-
|
29
|
+
identifier = "{*#{identifier}*}"
|
29
30
|
else
|
30
|
-
|
31
|
+
unless(link_url.index(/'[^'"]+'/).nil? and link_url.index(/"[^'"]+"/).nil?)
|
32
|
+
unless(link_url.index(/\|/).nil?)
|
33
|
+
add_tokens = link_url[/\|(.)+/][1..-1].split{"|"}
|
34
|
+
add_tokens.each{|add_token|
|
35
|
+
values = add_token.split("=")
|
36
|
+
add_attributes += " #{values[0]} = '#{values[1]}'"
|
37
|
+
}
|
38
|
+
link_url = link_url[/('|")[^'"]+('|")/][1...-1]
|
39
|
+
else
|
40
|
+
link_url = "#{link_url[1...-1]}"
|
41
|
+
end
|
42
|
+
else
|
43
|
+
link_url = "{*#{link_url}*}"
|
44
|
+
end
|
45
|
+
identifier = link_url
|
31
46
|
end
|
47
|
+
result = "<a href = '#{identifier}'#{add_attributes}>#{link_text}</a>"
|
32
48
|
|
33
49
|
result
|
34
50
|
}
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phrase_assembler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 1.2.
|
9
|
+
- 1
|
10
|
+
version: 1.2.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- "Lovro \xC5\xBDmak, Radan Skori\xC4\x87, Drap"
|