• Resolved cristobal-galleguillos-katz

    (@cristobal-galleguillos-katz)


    Hi.
    I’m having problems with image captions. If the caption contains brackets, it doesn’t get displayed correctly.

    How to recreate it.
    1) Insert an image with an empty caption.
    2) Change the caption to someting bracketed (eg. [in]out)
    3) Save. (The caption and the shortcode will be ok in the Visual Editor.)
    4) After the save, the caption will be displayed incorrectly. Only the text before the closing bracket is displayed correctly. The rest is displayed over the images (as opposed to a caption, that is displayed on the bottom), and with double quotes before the closing bracket.

    I think it has something to do with WP confusing this brackets with the shortcode ones (I’m just a newbie doing stuff in WP, so I might well as be wrong).

    Hope I can get some help an help WP get better and better.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Good day!

    First: [Brackets], {Braces}, (Parentheses)

    I tried all sorts of combinations, I see what you mean. If you just stick with parentheses () you can embed them.

    caption="(Ripose (Zap) 2004)" works
    BUT
    caption="(Ripose [Zap] 2004)" does not

    The first right bracket ] in the caption is closing the beginning statement.

    Clear as mud? Hope it helps!

    Have a great day!

    Thread Starter cristobal-galleguillos-katz

    (@cristobal-galleguillos-katz)

    Thanks for your reply, and for clearing out the differences.
    I’m really in a need to get brackets in my caption (using it to display some text where the difference between brackets and parentheses matters), and willing to help it work 🙂

    I tried HTML escaping the brackets and made some tests.

    If I insert the escaped brackets directly in HTML view in the editor, and then switch back to the Visual editor, the caption gets correctly displayed. If I then switch back to the HTML editor, the escaped brackets are replaced by their unescaped counterpart. If I make the switch back and forth one more time, the caption gets displayed wrong.

    Is this the way it should work, or is this a bug?
    Where should I look to try to make it work? (The problem seems to be in TinyMCE, isn’t it).

    Thanks!
    CGK

    Thread Starter cristobal-galleguillos-katz

    (@cristobal-galleguillos-katz)

    Do not switch back and forth between the visual and code view, it will mangle your code. If you are adding your own code, you should just use the html editor.

    You have to enter “&#91” for [ and “&#93” for ] minus quote marks.
    If you enter this into the HTML editor than switch to VISUAL you will see the brackets. However if you now switch BACK to the HTML you will see the brackets not the codes above, go figure.

    Hope this works for you!

    Thread Starter cristobal-galleguillos-katz

    (@cristobal-galleguillos-katz)

    After a while, I think the solution can be found here: http://anilmakhijani.com/2008/08/04/wordpress-26-and-captions/
    Haven’t tested it, but looks like that page lists all the places where changes need to be done to do what I wanted.
    Thanks everyone!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Caption with brackets not displayed correctly’ is closed to new replies.