Skip to content

Callout card changes in the new editor #17215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
fueko opened this issue Jul 5, 2023 · 1 comment
Closed
1 task done

Callout card changes in the new editor #17215

fueko opened this issue Jul 5, 2023 · 1 comment
Assignees
Labels
bug [triage] something behaving unexpectedly

Comments

@fueko
Copy link
Contributor

fueko commented Jul 5, 2023

Issue Summary

I noticed that the Callout card in the new editor now has a <p> and <span> paragraph added. Is this a deliberate change, because usually paragraphs have specific formatting, so it spoils the look of this card in themes.

In addition, sometimes the dir="ltr" parameter is added, sometimes not :)

New editor:

Zrzut ekranu 2023-07-5 o 20 03 16

Old editor:

Zrzut ekranu 2023-07-5 o 20 04 09

Steps to Reproduce

Add Callout card in the new editor and check code in browser.

Ghost Version

5.53.4

Node.js Version

v16.13.0

How did you install Ghost?

localhost

Database type

SQLite3

Browser & OS version

All

Relevant log / error output

No response

Code of Conduct

  • I agree to be friendly and polite to people in this repository
@github-actions github-actions bot added the needs:triage [triage] this needs to be triaged by the Ghost team label Jul 5, 2023
@RohitLakh
Copy link

The same thing is happening for the code block. Except they are converted into text nodes before rendering for the new editor

@daniellockyer daniellockyer added the bug [triage] something behaving unexpectedly label Jul 11, 2023
@github-actions github-actions bot removed the needs:triage [triage] this needs to be triaged by the Ghost team label Jul 11, 2023
ronaldlangeveld added a commit to TryGhost/Koenig that referenced this issue Jul 11, 2023
refs TryGhost/Ghost#17215

- Fixes an issue that caused some templates to render the card incorrectly.
- Refactored the renderCalloutNode function to parse the calloutText into a DOM tree using jsdom
- Created a cleanDOM helper function to traverse the DOM tree and remove unwanted HTML tags
- Retained only 'A', 'STRONG', and 'EM' tags in the HTML string to bring
  it in line with how mobiledoc rendered HTML.
ronaldlangeveld added a commit to TryGhost/Koenig that referenced this issue Jul 11, 2023
refs TryGhost/Ghost#17215

- Fixes an issue that caused some templates to render the card incorrectly.
- Refactored the renderCalloutNode function to parse the calloutText into a DOM tree using jsdom
- Created a cleanDOM helper function to traverse the DOM tree and remove unwanted HTML tags
- Retained only 'A', 'STRONG', and 'EM' tags in the HTML string to bring
  it in line with how mobiledoc rendered HTML.
kevinansfield pushed a commit that referenced this issue May 27, 2025
* 🐛 Fixed callout card render format

closes #17215

- Fixes an issue that caused some templates to render the card incorrectly.
- Refactored the renderCalloutNode function to parse the calloutText into a DOM tree using jsdom
- Created a cleanDOM helper function to traverse the DOM tree and remove unwanted HTML tags
- Retained only 'A', 'STRONG', and 'EM' tags in the HTML string to bring
  it in line with how mobiledoc rendered HTML.
kevinansfield pushed a commit that referenced this issue May 28, 2025
* 🐛 Fixed callout card render format

closes #17215

- Fixes an issue that caused some templates to render the card incorrectly.
- Refactored the renderCalloutNode function to parse the calloutText into a DOM tree using jsdom
- Created a cleanDOM helper function to traverse the DOM tree and remove unwanted HTML tags
- Retained only 'A', 'STRONG', and 'EM' tags in the HTML string to bring
  it in line with how mobiledoc rendered HTML.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [triage] something behaving unexpectedly
Projects
None yet
Development

No branches or pull requests

4 participants