Open emilbruckner opened 7 years ago
Hey @emilbruckner, I've confirmed this issue and agree that the outcome is not correct. There should either be two blocks or a single merged block with a newline between the two texts after deleting the empty block. Curiously, it works correctly with heading blocks.
Hi @emilbruckner and @javan,
I was doing a little digging into this issue and documented a few things.
As @javan mentioned, it works correctly with heading blocks. The document ends up having two blocks with the heading1
attribute. The generated html is <h1>abc</h1><h1>def</h1>
.
After following the steps to reproduce from @emilbruckner, the document also ends up having two blocks - this time with quote
attribute. However, the generated html is <blockquote>abcdef</blockquote>
.
I'm not too familiar with the source yet, so pardon me if any of this is obvious. If you set group: false
for quote in src/trix/config/block_attributes.coffee
, the generated html becomes <blockquote>abc</blockquote><blockquote>def</blockquote>
. However, this breaks a handful of tests, so I'm not sure if this is the right to go about it.
This issue has been automatically marked as stale after 90 days of inactivity. It will be closed if no further activity occurs.
I currently don’t work with trix, but I just tested this and the issue still exists. I haven’t looked into @djhopper01’s suggestion though
@javan I’ll leave it up to you whether this should be closed.
@javan I am interested to look into the issue and submit a PR possibly
It is possible to change the behavior of quote by customizing Trix configuration
Trix.config.blockAttributes.quote = { tagName: "blockquote", nestable: true, group: false };
When there are no paragraphs between two blockquotes, the blockquotes get merged into one. That alone is a problem for me (I sort content by blocks), but the biggest problem is, that not even any newline is kept → two words of different paragraphs become a single word It's the same with code-blocks
I would suggest that two blocks always stay two blocks. Is there a quick way to solve this via the api? Thank you
Steps to Reproduce
Details