Ignoring certain elements in decode-paragraphs
#22
Open
opened 5 years ago by zachmandeville
·
3 comments
Loading…
Reference in New Issue
There is no content yet.
Delete Branch '%!s(<nil>)'
Deleting a branch is permanent. It CANNOT be undone. Continue?
Hello!
I am making a pollen site that includes a form, which is organized into a series of fieldsets.
I would like to write the form like so:
(the text input will make a label and input based on #:for, with any text in the curly braces added as helper text)
The issue I'm having is that, when this renders, everything inside of fieldset gets wrapped in a
<p>
tag, and so the legend is not added correctly and it loses semantic clarity. I can remove the linebreaks in my page and solve the issue, but then the pollen file is hard to read.I have
decode-paragraphs
added in the style given in the pollen tutorial, and love it for the other pages in this site:I think it is causing the
<p>
tag wrapping on the form, though.Is it possible to have it pass over elements like
fieldset
, so I can get both the pollen file and html output I want?Thank you!
alternately: is there a recommended way to write a fieldset tag function so it's not wrapping things in
<p>
tags? If I could do it with a tag function, I'd want a fieldset structured like so:Currently, I have my functions defined as so:
For the fieldset, if I don't include the @elems it generates the proper html:
if I do include
,@elems
it wraps everything in fieldset in a p tag, including that explicitly defined legend:There must be something I'm doing wrong, but I'm baffled.
Thank you!
Try the
#:exclude-tags
option ofdecode-elements
.Also keep in mind that by default, Pollen treats
fieldset
as a block tag, so it gets some extra semantics that an ordinary tag function would not.Ah, this worked perfectly. Thank you!