Updated 10-May-2011 (added alternate option, thanks to Bob’s comment)
Publishers quite often generate multiple paragraph styles for bulleted and numbered lists behaviour. For instance the first or last bullet point in a list might have slightly different space before and after settings applied to it.
I’ve been working on demo materials for the upcoming Print and ePublishing conference and was using the following style names:
- Bullet 2
The styles were part of a style group named “Lists”.
For each of the paragraph styles I left the Tag option set to [Automatic]. This ensures that InDesign automatically generates
<li> tags in the resulting html correctly, based on the selected EPUB export options.
And I assigned the same class-names to Bullet-1 and Bullet-1-last (bullet-1, sticking to the recommendation for xhtml to use lowercase characters).
Then exported the Lists sample file I had ensuring Bullets are Mapped to Unordered Lists (which will generate
<li> tags in the resulting HTML:
You can imagine I was quite surpised to see InDesign generate the following in my HTML and template.css:
What InDesign’s doing here is recognising for the “Bullet-1-last” paragraph style that it needs to set the Class name to “bullet-1”. However, for this particular paragraph style (and “Bullet-2-Last”) it adds the Style Group name as a prefix.
It puzzled me… and I couldn’t let it go until I finally figured out how to fix this (I’m not one to give up easily 🙂 ). After trying a number of things:
Changing the paragraph style naming convention to not include the first hyphen seems to fix the issue. Turning “Bullet-1” into “Bullet1” and “Bullet-1-last” into “Bullet1-Last” etc.
As soon as I reran the EPUB export using the new style naming convention, the problem corrected itself, and InDesign correctly ignored the Style Group name when generating HTML and CSS.
Bob Levine (see comments below, thanks Bob!), points out you can also enter your own Tag as part of export settings. In running a quick test this morning (10-May), it seems that setting the Tag to
<li> tag also resolves the issue. So solution number 2 (and definitely the easier one) would be:
To retain original style naming and enter your own tags instead.
That leaves an interesting issue with [automatic] setting … to say the least 🙂 (maybe it is a feature? I’m not yet sure… will have to spend a little more time testing when I’ve got some more time on my hands later today).