UNRELIABLE IMAGE CAPTION

UNRELIABLE IMAGE CAPTION

Slim Shady
In this content image is inside <p> tag and there is no any additional classess to identify them.
In this content image caption is inside <em> tag and there is no any additional classess to identify them.

The only solution to make it image caption is searching for <p> tag that has child tag <img>, then searching for its following sibling that has <em> tag and combine them with <figure> tag.

The problem with this solution is that this way is technically incorrect.

There are two reasons that this caption must not be wrapped with <figcaption> tag:

  • First of all this type of captions are not stable enough to wrap them with <figcaption> tag. Because no one can guarantee that after image there's always caption inside <em> tag.
  • Secondly, there might be a lot of chances that inside <em> tag that follows <img> tag would be another texts.

For example, there might be pullquotos with italic texts.

So in this case, this type of captions must be left in the position where they are.



Report Page