Ghost icon indicating copy to clipboard operation
Ghost copied to clipboard

Unusual paragraph and span in a figcaption

Open fueko opened this issue 2 years ago • 7 comments

Issue Summary

In the case of adding a figcaption to a Code card, a paragraph with the attribute dir='ltr' is introduced. This unusual paragraph, occurring only in this case, disrupts the theme formatting.

Zrzut ekranu 2023-12-6 o 10 19 57

Additionally, a <span> element with the style white-space: pre-wrap; is included — this also appears to be undesirable. The span element is added to every figcaption, not just those within the code element.

Zrzut ekranu 2023-12-6 o 10 21 13

Steps to Reproduce

Add a Code card with a figcaption, then check the code.

Ghost Version

5.75.1

Node.js Version

18.12.1

How did you install Ghost?

localhost

Database type

SQLite3

Browser & OS version

All

Relevant log / error output

No response

Code of Conduct

  • [X] I agree to be friendly and polite to people in this repository

fueko avatar Dec 06 '23 09:12 fueko

HI @fueko I would like to fix this issue. Can you please assign it to me?

kushalsng avatar Dec 09 '23 11:12 kushalsng

I saw the new element is saved into database as well, not just auto-generated by code: <span class="white-space: pre-wrap;"> This is the caption</span>

Screenshot: img 1

At first I thought this was a new standard for saving caption. Glad it is a bug... :D

brvnnghi avatar Dec 09 '23 13:12 brvnnghi

HI @fueko I would like to fix this issue. Can you please assign it to me?

Hi @kushalsng, I'd like to address this issue, but not able to find where it comes from. Could you please direct me to the file where this code is injected? Thank you.

brvnnghi avatar Feb 26 '24 02:02 brvnnghi

HI @fueko I would like to fix this issue. Can you please assign it to me?

Hey there,

Have you worked on it? It seems the issue is still persisting.

robsoncoelho avatar Apr 03 '24 16:04 robsoncoelho

@daniellockyer Hello, I would like to upvote this bug. Or at least, confirm it's a bug or intented caption format?

brvnnghi avatar Jun 14 '24 11:06 brvnnghi

span's are expected and not a bug, themes should cope both with and without span being present.

p is little unexpected but it should be considered possible within themes because content is free-form - especially when using markdown or html cards - so those eventualities should be taken into account when styling.

@fueko do you see p embedded in fig captions frequently? If so are you able to determine if that happens in any specific cases?

kevinansfield avatar Aug 12 '24 09:08 kevinansfield