htmlgrid 1.1.7 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/lib/htmlgrid/booleanvalue.rb +14 -14
  3. data/lib/htmlgrid/button.rb +9 -9
  4. data/lib/htmlgrid/centeredcomposite.rb +21 -20
  5. data/lib/htmlgrid/component.rb +214 -197
  6. data/lib/htmlgrid/composite.rb +332 -301
  7. data/lib/htmlgrid/datevalue.rb +12 -12
  8. data/lib/htmlgrid/div.rb +9 -9
  9. data/lib/htmlgrid/divcomposite.rb +44 -43
  10. data/lib/htmlgrid/divform.rb +8 -8
  11. data/lib/htmlgrid/divlist.rb +17 -19
  12. data/lib/htmlgrid/divtemplate.rb +6 -6
  13. data/lib/htmlgrid/dojotoolkit.rb +54 -48
  14. data/lib/htmlgrid/errormessage.rb +47 -43
  15. data/lib/htmlgrid/form.rb +70 -62
  16. data/lib/htmlgrid/formlist.rb +14 -14
  17. data/lib/htmlgrid/grid.rb +111 -67
  18. data/lib/htmlgrid/image.rb +17 -16
  19. data/lib/htmlgrid/infomessage.rb +15 -14
  20. data/lib/htmlgrid/input.rb +34 -32
  21. data/lib/htmlgrid/inputcheckbox.rb +13 -13
  22. data/lib/htmlgrid/inputcurrency.rb +9 -9
  23. data/lib/htmlgrid/inputdate.rb +11 -11
  24. data/lib/htmlgrid/inputfile.rb +13 -12
  25. data/lib/htmlgrid/inputradio.rb +9 -9
  26. data/lib/htmlgrid/inputtext.rb +10 -10
  27. data/lib/htmlgrid/javascript.rb +17 -16
  28. data/lib/htmlgrid/label.rb +53 -49
  29. data/lib/htmlgrid/labeltext.rb +8 -8
  30. data/lib/htmlgrid/link.rb +31 -27
  31. data/lib/htmlgrid/list.rb +121 -110
  32. data/lib/htmlgrid/namedcomponent.rb +28 -25
  33. data/lib/htmlgrid/pass.rb +11 -11
  34. data/lib/htmlgrid/passthru.rb +20 -17
  35. data/lib/htmlgrid/popuplink.rb +41 -39
  36. data/lib/htmlgrid/reset.rb +8 -8
  37. data/lib/htmlgrid/richtext.rb +22 -20
  38. data/lib/htmlgrid/select.rb +28 -26
  39. data/lib/htmlgrid/span.rb +9 -9
  40. data/lib/htmlgrid/spancomposite.rb +18 -18
  41. data/lib/htmlgrid/spanlist.rb +9 -9
  42. data/lib/htmlgrid/staticinput.rb +14 -13
  43. data/lib/htmlgrid/submit.rb +9 -9
  44. data/lib/htmlgrid/template.rb +121 -105
  45. data/lib/htmlgrid/text.rb +9 -9
  46. data/lib/htmlgrid/textarea.rb +19 -17
  47. data/lib/htmlgrid/ulcomposite.rb +22 -22
  48. data/lib/htmlgrid/ullist.rb +9 -9
  49. data/lib/htmlgrid/urllink.rb +38 -36
  50. data/lib/htmlgrid/value.rb +9 -9
  51. data/lib/htmlgrid/version.rb +2 -2
  52. data/test/stub/cgi.rb +10 -7
  53. data/test/suite.rb +3 -3
  54. data/test/test_add_row.rb +12 -13
  55. data/test/test_component.rb +141 -91
  56. data/test/test_composite.rb +85 -46
  57. data/test/test_datevalue.rb +28 -24
  58. data/test/test_divlist.rb +126 -0
  59. data/test/test_dojotoolkit.rb +41 -26
  60. data/test/test_form.rb +89 -73
  61. data/test/test_formlist.rb +77 -65
  62. data/test/test_grid.rb +256 -208
  63. data/test/test_input.rb +37 -31
  64. data/test/test_interaction_list.rb +106 -70
  65. data/test/test_label.rb +91 -77
  66. data/test/test_list.rb +110 -95
  67. data/test/test_select.rb +35 -30
  68. data/test/test_template.rb +66 -55
  69. data/test/test_text.rb +36 -31
  70. metadata +17 -4
  71. data/TooltipDialog.txt +0 -73
  72. data/interaction_no_inline.txt +0 -1216
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b8ad0813834cb6bd2644994071c6801fe586942dc0923a1b4af96ad107763065
4
- data.tar.gz: e932567a95dff7cdf94b6d038de02947881be91bd8273ee9740118dc4f00522f
3
+ metadata.gz: a894cd7a5db3b2ca1cec59510012c4762173876fc0bba7024019467c4d31995a
4
+ data.tar.gz: c06fca0f6b632ecfc29d6c83540ebfc96ca595d883b7b66ff03c3ba6892c7ca5
5
5
  SHA512:
6
- metadata.gz: ecb7c4b18e3ad86bf65fa0910d37c63e36603cde3a8a0cb1d0d3fa0fcacaedf05d79cb14b20bf3b21789f4e69aefeea13503004733171b6fed39faf129358698
7
- data.tar.gz: 95a97292f4446b925718552fd3a51db0745275d1bd4f456a1e4948666ba5471580d41d0328d0ab25bac62aae4c48fb934408102f3ec1197b3220e641731a7483
6
+ metadata.gz: bd9cd290ee26db218bc675434031888db1067bdcb28105f656ad9ef8f1f9bbed20b518b83c7b72129ccdaa6e1412c037e9e17b6cf7f0b70aba34eb1f3fd79fab
7
+ data.tar.gz: e42dd5526ec2daca35de2eba08da359305424d1b04fa5d8bc2082b2a23b7d8dbbed109bd5ca162bb970db9839147800d90a491115433b3650fcc93467ac4e928
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- # encoding: utf-8
2
+
3
3
  #
4
4
  # HtmlGrid -- HyperTextMarkupLanguage Framework
5
5
  # Copyright (C) 2003 ywesee - intellectual capital connected
@@ -22,20 +22,20 @@
22
22
  # ywesee - intellectual capital connected, Winterthurerstrasse 52, CH-8006 Zuerich, Switzerland
23
23
  # htmlgrid@ywesee.com, www.ywesee.com
24
24
  #
25
- # BooleanValue -- oddb -- 28.07.2003 -- hwyss@ywesee.com
25
+ # BooleanValue -- oddb -- 28.07.2003 -- hwyss@ywesee.com
26
26
 
27
- require 'htmlgrid/namedcomponent'
27
+ require "htmlgrid/namedcomponent"
28
28
 
29
29
  module HtmlGrid
30
- class BooleanValue < NamedComponent
31
- LABEL = true
32
- def init
33
- bool = if(@model.respond_to?(@name) && @model.send(@name))
34
- :true
35
- else
36
- :false
37
- end
38
- @value = @lookandfeel.lookup(bool)
39
- end
40
- end
30
+ class BooleanValue < NamedComponent
31
+ LABEL = true
32
+ def init
33
+ bool = if @model.respond_to?(@name) && @model.send(@name)
34
+ :true
35
+ else
36
+ :false
37
+ end
38
+ @value = @lookandfeel.lookup(bool)
39
+ end
40
+ end
41
41
  end
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- # encoding: utf-8
2
+
3
3
  #
4
4
  # HtmlGrid -- HyperTextMarkupLanguage Framework
5
5
  # Copyright (C) 2003 ywesee - intellectual capital connected
@@ -22,15 +22,15 @@
22
22
  # ywesee - intellectual capital connected, Winterthurerstrasse 52, CH-8006 Zuerich, Switzerland
23
23
  # htmlgrid@ywesee.com, www.ywesee.com/htmlgrid
24
24
  #
25
- # Button -- htmlgrid -- 26.11.2002 -- hwyss@ywesee.com
25
+ # Button -- htmlgrid -- 26.11.2002 -- hwyss@ywesee.com
26
26
 
27
- require 'htmlgrid/staticinput'
27
+ require "htmlgrid/staticinput"
28
28
 
29
29
  module HtmlGrid
30
- class Button < StaticInput
31
- def init
32
- super
33
- @attributes['type'] = 'button'
34
- end
35
- end
30
+ class Button < StaticInput
31
+ def init
32
+ super
33
+ @attributes["type"] = "button"
34
+ end
35
+ end
36
36
  end
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- # encoding: utf-8
2
+
3
3
  #
4
4
  # HtmlGrid -- HyperTextMarkupLanguage Framework
5
5
  # Copyright (C) 2003 ywesee - intellectual capital connected
@@ -22,26 +22,27 @@
22
22
  # ywesee - intellectual capital connected, Winterthurerstrasse 52, CH-8006 Zuerich, Switzerland
23
23
  # htmlgrid@ywesee.com, www.ywesee.com/htmlgrid
24
24
  #
25
- # CenteredComposite -- htmlgrid -- 7.1.2003 -- hwyss@ywesee.com
25
+ # CenteredComposite -- htmlgrid -- 7.1.2003 -- hwyss@ywesee.com
26
26
 
27
- require 'htmlgrid/composite'
27
+ require "htmlgrid/composite"
28
28
 
29
29
  module HtmlGrid
30
- class CenteredComposite < Composite
31
- TABLE_ATTRIBUTES = {
32
- "style" => "margin-left:auto;margin-right:auto;text-align:left",
33
- }
34
- DIV_ATTRIBUTES = {
35
- "style" => "text-align:center;margin-left:auto;margin-right:auto;text-align:left",
36
- }
37
- def to_html(context)
38
- context.div(self::class::DIV_ATTRIBUTES) {
39
- super
40
- }
41
- end
42
- def init
43
- super
44
- @attributes.update(self::class::TABLE_ATTRIBUTES)
45
- end
46
- end
30
+ class CenteredComposite < Composite
31
+ TABLE_ATTRIBUTES = {
32
+ "style" => "margin-left:auto;margin-right:auto;text-align:left"
33
+ }
34
+ DIV_ATTRIBUTES = {
35
+ "style" => "text-align:center;margin-left:auto;margin-right:auto;text-align:left"
36
+ }
37
+ def to_html(context)
38
+ context.div(self.class::DIV_ATTRIBUTES) {
39
+ super
40
+ }
41
+ end
42
+
43
+ def init
44
+ super
45
+ @attributes.update(self.class::TABLE_ATTRIBUTES)
46
+ end
47
+ end
47
48
  end
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- # encoding: utf-8
2
+
3
3
  #--
4
4
  # HtmlGrid -- HyperTextMarkupLanguage Framework
5
5
  # Copyright (C) 2003 ywesee - intellectual capital connected
@@ -27,207 +27,224 @@
27
27
  #++
28
28
 
29
29
  module HtmlGrid
30
- class Component
31
- # sets the 'class' html-attribute
32
- CSS_CLASS = nil
33
- # sets the 'id' html-attribute
34
- CSS_ID = nil
35
- # other html-attributes
36
- HTML_ATTRIBUTES = {}
30
+ class Component
31
+ # sets the 'class' html-attribute
32
+ CSS_CLASS = nil
33
+ # sets the 'id' html-attribute
34
+ CSS_ID = nil
35
+ # other html-attributes
36
+ HTML_ATTRIBUTES = {}
37
37
  # default http-headers
38
38
  HTTP_HEADERS = {
39
- "Content-Type" => "text/html",
40
- "Cache-Control" => "no-cache, max-age=3600, must-revalidate",
39
+ "Content-Type" => "text/html",
40
+ "Cache-Control" => "no-cache, max-age=3600, must-revalidate"
41
41
  }
42
- # precede instances of this class with a label?
43
- LABEL = false
44
- @@html_entities = [
45
- ['&', 'amp'],
46
- ['<', 'lt'],
47
- ['>', 'gt'],
48
- ] # :nodoc:
49
- @@symbol_entities = {
50
- 34 => "forall",
51
- 36 => "exist",
52
- 42 => "lowast",
53
- 45 => "minus",
54
- 64 => "cong",
55
- 65 => "Alpha", 97 => "alpha",
56
- 66 => "Beta", 98 => "beta",
57
- 67 => "Chi", 99 => "chi",
58
- 68 => "Delta", 100 => "delta",
59
- 69 => "Epsilon", 101 => "epsilon",
60
- 70 => "Phi", 102 => "phi",
61
- 71 => "Gamma", 103 => "gamma",
62
- 72 => "Eta", 104 => "eta",
63
- 73 => "Iota", 105 => "iota",
64
- 75 => "Kappa", 107 => "kappa",
65
- 76 => "Lambda", 108 => "lambda",
66
- 77 => "Mu", 109 => "mu",
67
- 78 => "Nu", 110 => "nu",
68
- 79 => "Omicron", 111 => "omicron",
69
- 80 => "Pi", 112 => "pi",
70
- 81 => "Theta", 113 => "theta",
71
- 82 => "Rho", 114 => "rho",
72
- 83 => "Sigma", 115 => "sigma",
73
- 84 => "Tau", 116 => "tau",
74
- 85 => "Upsilon", 117 => "upsilon",
75
- 86 => "sigmaf",
76
- 87 => "Omega", 119 => "omega",
77
- 88 => "Xi", 120 => "xi",
78
- 89 => "Psi", 121 => "psi",
79
- 90 => "Zeta", 122 => "zeta",
80
- 94 => "perp", 126 => "sim",
81
- 163 => "le",
82
- 165 => "infin",
83
- 166 => "fnof",
84
- 171 => "harr",
85
- 172 => "larr",
86
- 173 => "uarr",
87
- 174 => "rarr",
88
- 175 => "darr",
89
- 179 => "ge",
90
- 181 => "prop",
91
- 182 => "part",
92
- 185 => "ne",
93
- 186 => "equiv",
94
- 187 => "asymp",
95
- 191 => "crarr",
96
- 196 => "otimes",
97
- 197 => "oplus",
98
- 198 => "empty",
99
- 199 => "cap",
100
- 200 => "cup",
101
- 201 => "sup",
102
- 202 => "supe",
103
- 203 => "nsub",
104
- 204 => "sub",
105
- 205 => "sube",
106
- 206 => "isin",
107
- 207 => "notin",
108
- 208 => "ang",
109
- 209 => "nabla",
110
- 213 => "prod",
111
- 214 => "radic",
112
- 215 => "sdot",
113
- 217 => "and",
114
- 218 => "or",
115
- 219 => "hArr",
116
- 220 => "lArr",
117
- 221 => "uArr",
118
- 222 => "rArr",
119
- 223 => "dArr",
120
- 229 => "sum",
121
- 242 => "int",
122
- } # :nodoc:
123
- attr_reader :attributes, :model
124
- attr_accessor :value
125
- def initialize(model, session=nil, container=nil)
126
- @model = model
127
- @session = session
128
- @lookandfeel = session.lookandfeel if session.respond_to?(:lookandfeel)
129
- @container = container
130
- @attributes = self::class::HTML_ATTRIBUTES.dup
131
- if(css_class())
132
- @attributes.store("class", css_class())
133
- end
134
- if(css_id())
135
- @attributes.store("id", css_id())
136
- end
137
- @value = nil
138
- @label = self::class::LABEL
139
- init()
140
- end
141
- # delegator to @container, default definition in Form
142
- def autofill?
143
- @container.autofill? if @container.respond_to?(:autofill?)
144
- end
145
- # gets the 'class' html-attribute if defined
146
- def css_class
147
- @css_class ||= self::class::CSS_CLASS
148
- end
149
- # sets the 'class' html-attribute
150
- def css_class=(css_class)
151
- @css_class = @attributes['class'] = css_class
152
- end
153
- # gets the 'id' html-attribute if defined
154
- def css_id
155
- @css_id ||= self::class::CSS_ID
156
- end
157
- # sets the 'id' html-attribute
158
- def css_id=(css_id)
159
- @css_id = @attributes['id'] = css_id
160
- end
161
- def dynamic_html(context)
162
- ''
163
- end
164
- # escape '&', '<' and '>' characters in txt
165
- def escape(txt)
166
- @@html_entities.inject(txt.to_s.dup) { |str, map|
167
- char, entity = map
168
- str.gsub!(char, '&' << entity << ';')
169
- str
170
- }
171
- end
172
- # escape symbol-font strings
173
- def escape_symbols(txt)
174
- esc = ''
175
- txt.to_s.each_byte { |byte|
176
- esc << if(entity = @@symbol_entities[byte])
177
- '&' << entity << ';'
178
- else
42
+ # precede instances of this class with a label?
43
+ LABEL = false
44
+ @@html_entities = [
45
+ ["&", "amp"],
46
+ ["<", "lt"],
47
+ [">", "gt"]
48
+ ] # :nodoc:
49
+ @@symbol_entities = {
50
+ 34 => "forall",
51
+ 36 => "exist",
52
+ 42 => "lowast",
53
+ 45 => "minus",
54
+ 64 => "cong",
55
+ 65 => "Alpha", 97 => "alpha",
56
+ 66 => "Beta", 98 => "beta",
57
+ 67 => "Chi", 99 => "chi",
58
+ 68 => "Delta", 100 => "delta",
59
+ 69 => "Epsilon", 101 => "epsilon",
60
+ 70 => "Phi", 102 => "phi",
61
+ 71 => "Gamma", 103 => "gamma",
62
+ 72 => "Eta", 104 => "eta",
63
+ 73 => "Iota", 105 => "iota",
64
+ 75 => "Kappa", 107 => "kappa",
65
+ 76 => "Lambda", 108 => "lambda",
66
+ 77 => "Mu", 109 => "mu",
67
+ 78 => "Nu", 110 => "nu",
68
+ 79 => "Omicron", 111 => "omicron",
69
+ 80 => "Pi", 112 => "pi",
70
+ 81 => "Theta", 113 => "theta",
71
+ 82 => "Rho", 114 => "rho",
72
+ 83 => "Sigma", 115 => "sigma",
73
+ 84 => "Tau", 116 => "tau",
74
+ 85 => "Upsilon", 117 => "upsilon",
75
+ 86 => "sigmaf",
76
+ 87 => "Omega", 119 => "omega",
77
+ 88 => "Xi", 120 => "xi",
78
+ 89 => "Psi", 121 => "psi",
79
+ 90 => "Zeta", 122 => "zeta",
80
+ 94 => "perp", 126 => "sim",
81
+ 163 => "le",
82
+ 165 => "infin",
83
+ 166 => "fnof",
84
+ 171 => "harr",
85
+ 172 => "larr",
86
+ 173 => "uarr",
87
+ 174 => "rarr",
88
+ 175 => "darr",
89
+ 179 => "ge",
90
+ 181 => "prop",
91
+ 182 => "part",
92
+ 185 => "ne",
93
+ 186 => "equiv",
94
+ 187 => "asymp",
95
+ 191 => "crarr",
96
+ 196 => "otimes",
97
+ 197 => "oplus",
98
+ 198 => "empty",
99
+ 199 => "cap",
100
+ 200 => "cup",
101
+ 201 => "sup",
102
+ 202 => "supe",
103
+ 203 => "nsub",
104
+ 204 => "sub",
105
+ 205 => "sube",
106
+ 206 => "isin",
107
+ 207 => "notin",
108
+ 208 => "ang",
109
+ 209 => "nabla",
110
+ 213 => "prod",
111
+ 214 => "radic",
112
+ 215 => "sdot",
113
+ 217 => "and",
114
+ 218 => "or",
115
+ 219 => "hArr",
116
+ 220 => "lArr",
117
+ 221 => "uArr",
118
+ 222 => "rArr",
119
+ 223 => "dArr",
120
+ 229 => "sum",
121
+ 242 => "int"
122
+ } # :nodoc:
123
+ attr_reader :attributes, :model
124
+ attr_accessor :value
125
+ def initialize(model, session = nil, container = nil)
126
+ @model = model
127
+ @session = session
128
+ @lookandfeel = session.lookandfeel if session.respond_to?(:lookandfeel)
129
+ @container = container
130
+ @attributes = self.class::HTML_ATTRIBUTES.dup
131
+ if css_class
132
+ @attributes.store("class", css_class)
133
+ end
134
+ if css_id
135
+ @attributes.store("id", css_id)
136
+ end
137
+ @value = nil
138
+ @label = self.class::LABEL
139
+ init
140
+ end
141
+
142
+ # delegator to @container, default definition in Form
143
+ def autofill?
144
+ @container.autofill? if @container.respond_to?(:autofill?)
145
+ end
146
+
147
+ # gets the 'class' html-attribute if defined
148
+ def css_class
149
+ @css_class ||= self.class::CSS_CLASS
150
+ end
151
+
152
+ # sets the 'class' html-attribute
153
+ def css_class=(css_class)
154
+ @css_class = @attributes["class"] = css_class
155
+ end
156
+
157
+ # gets the 'id' html-attribute if defined
158
+ def css_id
159
+ @css_id ||= self.class::CSS_ID
160
+ end
161
+
162
+ # sets the 'id' html-attribute
163
+ def css_id=(css_id)
164
+ @css_id = @attributes["id"] = css_id
165
+ end
166
+
167
+ def dynamic_html(context)
168
+ ""
169
+ end
170
+
171
+ # escape '&', '<' and '>' characters in txt
172
+ def escape(txt)
173
+ @@html_entities.each_with_object(txt.to_s.dup) { |map, str|
174
+ char, entity = map
175
+ str.gsub!(char, "&" << entity << ";")
176
+ }
177
+ end
178
+
179
+ # escape symbol-font strings
180
+ def escape_symbols(txt)
181
+ esc = ""
182
+ txt.to_s.each_byte { |byte|
183
+ esc << if (entity = @@symbol_entities[byte])
184
+ "&" << entity << ";"
185
+ else
179
186
  byte
180
- end
181
- }
182
- esc
183
- end
184
- # delegator to @container, default definition in Form
185
- def formname
186
- @container.formname if @container.respond_to?(:formname)
187
- end
188
- def http_headers
189
- self::class::HTTP_HEADERS.dup
190
- end
191
- # precede this instance with a label?
192
- def label?
193
- @label
194
- end
195
- def label=(boolean)
196
- @label = boolean
197
- end
198
- def onclick=(onclick)
199
- @attributes['onclick'] = onclick
200
- end
201
- # delegator to @container, default definition in Template
202
- def onload=(onload)
203
- @container.onload = onload if(@container.respond_to? :onload=)
204
- end
205
- # delegator to @container, default definition in Form
206
- def onsubmit=(onsubmit)
207
- @container.onsubmit = onsubmit if(@container.respond_to? :onsubmit=)
208
- end
209
- # set a html attribute
210
- def set_attribute(key, value)
211
- @attributes.store(key, value)
212
- end
213
- def tabindex=(tab)
214
- @attributes.store('tabIndex', tab.to_s)
215
- end
187
+ end
188
+ }
189
+ esc
190
+ end
191
+
192
+ # delegator to @container, default definition in Form
193
+ def formname
194
+ @container.formname if @container.respond_to?(:formname)
195
+ end
196
+
197
+ def http_headers
198
+ self.class::HTTP_HEADERS.dup
199
+ end
200
+
201
+ # precede this instance with a label?
202
+ def label?
203
+ @label
204
+ end
205
+
206
+ attr_writer :label
207
+
208
+ def onclick=(onclick)
209
+ @attributes["onclick"] = onclick
210
+ end
211
+
212
+ # delegator to @container, default definition in Template
213
+ def onload=(onload)
214
+ @container.onload = onload if @container.respond_to? :onload=
215
+ end
216
+
217
+ # delegator to @container, default definition in Form
218
+ def onsubmit=(onsubmit)
219
+ @container.onsubmit = onsubmit if @container.respond_to? :onsubmit=
220
+ end
221
+
222
+ # set a html attribute
223
+ def set_attribute(key, value)
224
+ @attributes.store(key, value)
225
+ end
226
+
227
+ def tabindex=(tab)
228
+ @attributes.store("tabIndex", tab.to_s)
229
+ end
230
+
216
231
  def to_html(context)
217
- _to_html(context, @value).to_s.encode('utf-8')
232
+ _to_html(context, @value).to_s.encode("utf-8")
218
233
  end
219
234
  @@nl2br_ptrn = /(\r\n)|(\n)|(\r)/
220
- def _to_html(context, value=@value)
221
- if(value.is_a?(Array))
222
- value.collect { |item| _to_html(context, item) }.join(' ')
223
- elsif(value.respond_to?(:to_html))
224
- value.to_html(context).to_s.force_encoding('utf-8')
225
- else
226
- value =CGI.unescape(value) if value && value.is_a?(String)
227
- end
228
- end
229
- private
230
- def init
231
- end
232
- end
235
+ def _to_html(context, value = @value)
236
+ if value.is_a?(Array)
237
+ value.collect { |item| _to_html(context, item) }.join(" ")
238
+ elsif value.respond_to?(:to_html)
239
+ value.to_html(context).to_s.dup.force_encoding("utf-8")
240
+ elsif value&.is_a?(String)
241
+ _value = CGI.unescape(value.gsub("+", CGI.escape("+")))
242
+ end
243
+ end
244
+
245
+ private
246
+
247
+ def init
248
+ end
249
+ end
233
250
  end