Green_shoes initial woes

Hi, just started with green_shoes this morning by installing the gem.
Unfortunately, my first simple program fell over with this error.

I have an array of strings that I fill in as follows:

do|field|
items.push("#{field[:name]}")
end

(I can print the items object and see all the strings I stuffed)

Then I created a Shoes app:

Shoes.app do
items.each do |i|
para i
end
end

This produces:
/green_shoes-1.1.374/lib/shoes/helper_methods.rb:127:in
`parse_markup’: Error on line 1: Character ’ ’ is not valid at the start
of an entity name; the & character begins an entity; if this ampersand
isn’t supposed to be an entity, escape it as & (GLib::Error)

I also tried:

str = items.map { |i| i.to_s }.join("\n")

and

Shoes.app do
para str
end

and this produces the same error as above.

Any help will be much appreciated!

Hi Baban,

Could you show us the output of the following code which use p instead
of
para? I want to know the strings you pushed into items.

Shoes.app do
items.each do |i|
p i
end
end

Regards,
ashbb

Something in your names isn’t escaped properly. Looks like you might
have a name containing ‘&’.
What’s in the variable ‘field’?

Joel P. wrote in post #1110369:

Something in your names isn’t escaped properly. Looks like you might
have a name containing ‘&’.
What’s in the variable ‘field’?

Thanks ashbb and Joel! There was indeed an ‘&’ in one of the strings.
However, I can see the same issue with:

str = “hello \& bye”

Shoes.app {para str}

Baban By wrote in post #1110376:

Joel P. wrote in post #1110369:

Something in your names isn’t escaped properly. Looks like you might
have a name containing ‘&’.
What’s in the variable ‘field’?

Thanks ashbb and Joel! There was indeed an ‘&’ in one of the strings.
However, I can see the same issue with:

str = “hello \& bye”

Shoes.app {para str}

Scratch that. I did not read the message carefully. This works just
fine:

str = ‘hello & bye’
Shoes.app {para str}

Thanks for the prompt help!

Using CGI.escapeHTML on each string would probably be a better long-term
solution.