Paragraphs and figures#240
Paragraphs and figures#240jeffreyguenther wants to merge 3 commits intobasecamp:masterfrom LoamStudios:paragraphs_and_figures
Conversation
|
Here are few more thoughts about rendering the block without a root element: I think it keep generated HTML lean and semantic. A custom root element or div is not necessary to display the content, so in the name of terse, clean HTML, it should be avoided. It will also provide a generic solution so other kinds of characters can be represented by sets of markup. An attachment is represented by an object replacement character. If you want to represent a page break, you can represent it with a form feed character. The page break can be used to mark where to do pagination on render and might be represented by a styled What is the best way to remove the root element? Does not having a root element affect selection and the cursor? |
|
Instead of changing the behavior of attachment pieces, it might be easier and more desirable to allow configuring the html structure used to render attachments. That way people who switch from the default |
|
If an attachment is rendered in a phrase-content-only default block ( If people are allowed to choose the template, I think we should do it in a template engine agnostic way so people can use their favourite engine. A I think it might even be worth allowing people to set the renderer for each block type. Then if an attachment is isolated to it's own block and the correct block attribute applied, Trix will know how to render it. |
|
@jeffreyguenther why was this closed? |
|
It's been a long time since I did this work, but I believe it's because the work was out of scope of what the maintainers wanted/I didn't have the capacity to develop it further. My memory is a little fuzzy. |
I'm opening this PR to start discussing what needs to be done to move attachments and their corresponding
<figure>elements outside of the<p>when it's the default block (Addressed in #202). The attachment is represented as anAttachmentPieceand we need to treat it as a block.One way we can do this by adding the block attribute
attachment:We could create a
<trix-attachment>element and use it to represent the piece.Another option is to render the block without a root element, though I think this will require more modification in the renderer.
@javan, @sstephenson, which do you prefer?