I’m a big fan of InDesign’s HTML export. I use it a lot to get magazine content created for print with InDesign to export cleanly and efficiently for posting online. However, the more I work with HTML export in CS6, the more baffled I am at the changes that have been made, and the more I pine for the markup I was used to in CS5.5.
Case in point, a very specific and puzzling bug that I just found while testing how tables using Table and Cell Styles get marked up. I had a table that used a consistent style for all of the numeric figures within its cells. As I always do, I tried to make the style as robust as possible, and built a GREP style into it that would change the color of any negative number to red by applying a character style called “Negative Numbers” automatically wherever a value began with a dash (minus sign).
However, upon exporting it to HTML from CS6, I discovered that the markup includes the character style name twice in the SPAN tag that gets wrapped around any text to which it’s applied. What I get in my HTML is this:
<span class=”Negative-Numbers Negative-Numbers”>
That’s just bizarre. And it happens consistently to all SPAN tags generated for formatting triggered by a GREP or Nested Style…but only within table cells! It doesn’t happen if you use the exact same style outside of a table. In that case, InDesign creates the following (correct) SPAN tag:
I fired up CS5.5 to see if this has always been the case and I just never noticed it before, but the problem doesn’t exist in that version. Text is correctly tagged whether it’s in a table or whether it’s not. So this is a new behavior that’s cropped up in CS6.
I’ve filed a bug report using the form on Adobe.com, and I’ll update this post if I hear back or get any resolution to the problem. For now, though, this seems like a weird behavior we’ve got to live with until this and other HTML-related bugs get squashed by the engineers.
UPDATE (3 January 2012): After Anne-Marie’s comment below, I did a test EPUB export of the same file and the problem occurs when exporting to that format as well. I changed the title of this post accordingly.