Skip to content
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

Markdown card and new editor render <blockquote> differently #10007

Closed
jbfriedrich opened this issue Oct 14, 2018 · 2 comments
Closed

Markdown card and new editor render <blockquote> differently #10007

jbfriedrich opened this issue Oct 14, 2018 · 2 comments

Comments

@jbfriedrich
Copy link

Issue Summary

When I use blockquote inside the new editor, the HTML output is rendered as follows:

<div class="article-post post page">
<blockquote>This is a test. I am a quote</blockquote>
<h3>I am just a header</h3>
<p>Disregard this text right now</p>    
[...]
</div>

When the Markdown card is used, then the same content has a different HTML output:

<div class="article-post post page">
<blockquote>
<p>This is a test. I am a quote</p>
</blockquote>
<h3 id="iamjustaheader">I am just a header</h3>
<p>Disregard this text right now</p>

This messes with the CSS of my theme, so that blockquote looks "broken" when the Markdown card is used.

screen shot 2018-10-14 at 18 10 18

This is very unfortunate for people who are migrating to Ghost 2.x, since the importer uses the Markdown card to import 1.x blog posts by default.

I also posted this issue in the Ghost Forums.

To Reproduce

  • Create a new post
  • Use blockquote in the editor and in a Markdown card
  • See the different rendering in source code

Technical details:

  • Ghost Version: 2.2.2
  • Node Version: 6.11.2
  • Browser/OS: Mac/Windows and Chrome 69
  • Database: MySQL 5.7
@kevinansfield
Copy link
Member

@jbfriedrich this is expected behaviour. The markdown output has not changed between 1.x and 2.x and can't change for backwards-compatibility as it's how 1.x content is "migrated" to 2.x (in reality there's no real migration happening because 1.x already used the 2.x mobiledoc format).

If you are writing themes then your CSS should handle all valid forms of blockquote markup. The Markdown, Embed, and HTML cards all allow completely freeform HTML so there's no guarantee that a <blockquote> will have a specific format - you may have content which has multiple <p> tags along with a <footer> element for example.

@mindsers
Copy link

@kevinansfield So, how can we handle the fact we have to add quotes on blockquotes tag only if there aren't p tags inside of it? If there are p tags into the blockquotes tag we have to add the quotes on the p tag to avoid the behavior exposed above and maintain the same behavior between 1.x content and 2.x content. This is not possible in CSS.

Also, semantically, when I want to quote many paragraphs, why does the 2.x editor not use p tags to separate my paragraphs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants