Welcome to the in5 Answer Exchange! This a place to get answers about in5 (InDesign to HTML5) and make requests.
0 votes
Hi,

sometimes a rectangle is generated as a div sometimes an img.
In this example I do not see why one is an img and the others are divs. Is there a way to force the right rectangle to become a div?

https://www.dropbox.com/s/gld4a22ur2y4sdq/div%20vs%20image.zip?dl=0

Thanks,
Wim
in how_to by (430 points)
  
Thanks for including the file, Wim. I'll take a look and get back to you.

1 Answer

+1 vote
 
Best answer

Hi Wim,

This took some digging. Under the hood, InDesign considers the last item in your example file a "polygon" not a "rectangle", thus in5 renders it as an <img>.

There are multiple ways a rectangle is not considered a rectangle by InDesign (drawing with the pen tool, starting with another shape and using Convert Shape to convert to a Rectangle, etc).

in5 does have a rectangular validation mechanism (for rectangles that have been manipulated or converted, but InDesign still calls them "rectangles"), but I'm hesitant to apply it in this case because it could have unintended consequences.

Hopefully that explanation helps you in setting up your files.

by (197k points)
selected by
Wow, thanks Justin! I thought it had something to do with polygons, but I did not see that particular rectangle being a polygon. Guess in case of doubt I better just delete and redraw.
Yeah, (without scripting) InDesign doesn't really give you an indication of this onscreen. It would be nice if Convert to Rectangle actually converted the underlying object to rectangle. :-)