Labels with HTML tags

8 views
Skip to first unread message

Matthias Dietrich

unread,
Dec 19, 2011, 11:11:45 AM12/19/11
to formh...@googlegroups.com
Hi,

I don't understand HFH doesn't allow any kind of HTML attributes inside a label. According to the HTML(4) spec labels are allowed to contain inline elements such as <i>, <span> etc., except <label> itself. HFH also doesn't provide an option to not finder HTML tags (or at least I couldn't find one). Can someone explain the reason for this?

Another question: is the IRC chat still used? Are the devs of this module all located in one time zone that doesn't fit to mine? :-)

Best,
Matthias

Gerda Shank

unread,
Dec 19, 2011, 1:34:13 PM12/19/11
to formh...@googlegroups.com
Matthias:

The IRC chat is still used... I just went out for lunch. I'm in US
Eastern time zone, which is usually Greenwich +5.

I'm adding some label attributes. I can push it to the repo.

Not sure I understand "not finder HTML tags". You mean you don't want
any tags?

Gerda

Matthias Dietrich

unread,
Dec 19, 2011, 1:51:15 PM12/19/11
to formh...@googlegroups.com, formh...@googlegroups.com
Hi,

Am 19.12.2011 um 19:34 schrieb Gerda Shank <gerda...@gmail.com>:

> Matthias:
>
> The IRC chat is still used... I just went out for lunch. I'm in US Eastern time zone, which is usually Greenwich +5.

Good to know :-)

> I'm adding some label attributes. I can push it to the repo.

Ok. Could you take a look at my branch? But I think your solution will be better and more future proof.


> Not sure I understand "not finder HTML tags". You mean you don't want any tags?

That should have said "filter", sorry. "To not filter HTML tags."

I think HFH should also provide an attributes for not adding ": " to a label because it may break style and CI.

Best


> On 12/19/11 11:11 AM, Matthias Dietrich wrote:
>> Hi,
>>
>> I don't understand HFH doesn't allow any kind of HTML attributes inside a label. According to the HTML(4) spec labels are allowed to contain inline elements such as<i>,<span> etc., except<label> itself. HFH also doesn't provide an option to not finder HTML tags (or at least I couldn't find one). Can someone explain the reason for this?
>>
>> Another question: is the IRC chat still used? Are the devs of this module all located in one time zone that doesn't fit to mine? :-)
>>
>> Best,
>> Matthias
>>
>

> --
> You received this message because you are subscribed to the Google Groups "formhandler" group.
> To post to this group, send email to formh...@googlegroups.com.
> To unsubscribe from this group, send email to formhandler...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/formhandler?hl=en.
>

Gerda Shank

unread,
Dec 19, 2011, 2:35:10 PM12/19/11
to formh...@googlegroups.com
I've added 'label_attr' and 'wrapper_attr' to the repo. Please check it
out and see if it does what you want with regard to label attributes.
There's a very brief test in t/html_attr.t.

I'll do something about the colon later this evening, when I get some
more time.

Gerda

Matthias Dietrich

unread,
Dec 19, 2011, 4:45:23 PM12/19/11
to formh...@googlegroups.com, formh...@googlegroups.com
Hi Gerda,

thanks for pushing the changes. Unfortunately there seems to be a misunderstanding: I wanted to let the label (the text) to contain HTML tags, not that the <label> tag can contain HTML attributes.

Imagine you have a label "Market" and want to add a hint to it. I used to write the label as: "Market <i>The market you work most</i>". HFH now runs html_filter() on the label text so that the < and > signs will be converted to &gt; and &lt;.

Please take a look at my branch/fork at https://github.com/rainboxx/html-formhandler/commit/4a322916ddb875bdb55878acb0dde6ff602c626a, I made some changes which do what I want. Don't know if they work for all render methods etc. and tests are missing. Maybe there's also a better way to implement this "requirement".

Best,
Matthias

--

Sent from my iPhone so expect spelling errors and stuff.

rainboxx Matthias Dietrich
Freelance Software Engineer

rainboxx
Königsallee 43
71638 Ludwigsburg
+4915150607864

Vist: http://www.rainboxx.de

Gerda Shank

unread,
Dec 19, 2011, 7:07:39 PM12/19/11
to formh...@googlegroups.com
Matthias:

Sorry for the misunderstanding.

You can set the html filter off for that field:
has_field 'bar' => ( render_filter => sub { shift } );

I'll have to look at the issue of turning it off just for labels. There
are already too many flags floating around...

Gerda

Reply all
Reply to author
Forward
0 new messages