Ghost
Ghost copied to clipboard
Unusual paragraph and span in a figcaption
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.
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.
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
HI @fueko I would like to fix this issue. Can you please assign it to me?
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:
At first I thought this was a new standard for saving caption. Glad it is a bug... :D
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.
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.
@daniellockyer Hello, I would like to upvote this bug. Or at least, confirm it's a bug or intented caption format?
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?