Skip to content

[Enhancement] re-enable pandoc div rendering#6121

Merged
nathanlesage merged 10 commits into
Zettlr:developfrom
benniekiss:enable-pandoc
Feb 19, 2026
Merged

[Enhancement] re-enable pandoc div rendering#6121
nathanlesage merged 10 commits into
Zettlr:developfrom
benniekiss:enable-pandoc

Conversation

@benniekiss

Copy link
Copy Markdown
Collaborator

Description

This PR re-enables pandoc div rendering by using the new BlockWrapper api

Changes

The pandoc div and span renderers were separated because BlockWrappers have a similar, but different, structure and typing than Decorations.

The div renderer was updated to use BlockWrappers, which essentially wraps the given range in a separate HTML element. This provides better styling than Decoration.line because the entire content is wrapped in one parent element.

An additional blockwrapper was added around the opening and closing lines of the pandoc div to essentially revert the styling of parent divs. I did this so that those regions do not receive most styling from the parent pandoc div, making them easier to pick out when div rendering is enabled. This is a very simple override, and there is still some styling that applies. Another approach would be to use a widget across these regions, but that would have to be applied in a separate renderer function since those are applied as Decoration objects.

Additional information

Screenshot 2026-01-10 at 13 04 10

the lightGreen section is a blockquote, which is why the font color is different

Tested on: macOS 26/Fedora 43

@benniekiss benniekiss changed the title [enhancement] re-enable pandoc div rendering [Enhancement] re-enable pandoc div rendering Jan 10, 2026
@benniekiss

benniekiss commented Jan 10, 2026

Copy link
Copy Markdown
Collaborator Author

Column rendering almost works. However, It messes with the cursor positioning below the rendered columns, probably due to using flex containers

Screenshot 2026-01-10 at 18 53 00

@benniekiss benniekiss force-pushed the enable-pandoc branch 2 times, most recently from 41641c8 to e1f90c1 Compare February 7, 2026 18:10

@nathanlesage nathanlesage left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general this looks good, I only have a few concerns and questions.

Comment thread source/common/modules/markdown-editor/renderers/render-pandoc-div-span.ts Outdated
Comment thread source/common/modules/markdown-editor/renderers/render-pandoc-div-span.ts Outdated
Comment thread source/common/modules/markdown-editor/renderers/render-pandoc-div-span.ts Outdated
Comment thread source/common/modules/markdown-editor/renderers/render-pandoc-div-span.ts Outdated
Comment thread source/common/modules/markdown-editor/renderers/render-pandoc-div-span.ts Outdated
* better UX -- since the mark lines hide styling,
* things like border radius become hidden
* blockwrappers should not alter the dom layout,
* so we disallow rendering styles, such as
* `display: flex`, `width`, and `height`, which
* would otherwise alter the layout
@nathanlesage

Copy link
Copy Markdown
Member

Looks good now, ready for merging, thank you very much once more!

@nathanlesage nathanlesage merged commit c5867e3 into Zettlr:develop Feb 19, 2026
1 check passed
@benniekiss benniekiss deleted the enable-pandoc branch February 19, 2026 18:20
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

Successfully merging this pull request may close these issues.

2 participants