• Hello,

    We’re facing the same issue as OP in https://wordpress.org/support/topic/image-figcaption/

    Was that resolved? What we currently have is:

    `
    <figure class=”wp-class”><img src=”file.jpg” alt=”alt-text” class=”wp-class” /><figcaption>caption here</figcaption></figure>
    <p>Next paragraph text here</p>
    `

    That turns into this:

    `
    <figure><img src=”file.jpg” /></figure><figcaption>caption here</figcaption>Next paragraph text here</p>
    `

    This means that for any <figure> where we add a figcaption, either via wp 5.2.x’s built-in block/gutenberg editor or through code view, both the caption and the proceeding paragraph doesn’t get rendered in the FB Instant Article view because:

    1. The figcaption has been broken out of its original containing figure tag
    2. The opening <p> tag for the proceeding paragraph disappears, making its syntax invalid.
    3. The contents of both figcaption and the next paragraph (for which the opening <p> tag has disappeared) still appear in the instant article feed produced by WP Native Articles.

    i’ve tried the following transform rules, to no avail:

    `
    <!– match: –>
    <figure class=”%s”><img src=”%s” alt=”%s” class=”%s” /><figcaption>%s</figcaption></figure>

    <!– to: –>
    <figure><img src=”${2}” /><figcaption>${5}</figcaption></figure>

    <!– match: –>
    <figcaption>%s</figcaption>

    <!– to: –>
    <figcaption>${1}</figcaption><p>
    `

    Please advise; thanks!
    (I can email a link to our instant article feed + specific instances where this occurs, or code snippets if required)

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘figcaption transform bug’ is closed to new replies.