Skip to content

HAR-9516, HAR-9571 - add default spacing to paragraph#551

Merged
harbournick merged 1 commit intomainfrom
artem-spacing-v1
Jun 4, 2025
Merged

HAR-9516, HAR-9571 - add default spacing to paragraph#551
harbournick merged 1 commit intomainfrom
artem-spacing-v1

Conversation

@artem-harbour
Copy link
Copy Markdown
Contributor

@artem-harbour artem-harbour commented Jun 4, 2025

Paragraphs must have default spacing with zero margin, otherwise there may be spacing issues on the next import.

Here are some cases where this can happen:

  1. We import a docx file that has a default margin for paragraphs (in default styles). When creating a table, paragraphs inside have no margins. During the next import, we go through the style chain - inline attributes (margin not found), but it is found in default styles and will be applied to the paragraph.

  2. We import a docx file in which formatting styles are defined by id (heading1, heading2, etc). Next, we create new paragraphs (they don’t have margins) and apply formatting styles to them, for example Heading 2. On the next import we go through the style chain - inline margins are not found, but they are found by the formatting style ID in this file and will be applied (although there were no margins in the editor).

Note:

  • Also, when exporting, we save the current spacing in inline attributes, so that the next time we import it, it will be taken from the attributes (and not from default styles or by id).

@artem-harbour artem-harbour self-assigned this Jun 4, 2025
@artem-harbour artem-harbour marked this pull request as ready for review June 4, 2025 17:50
@artem-harbour artem-harbour requested a review from harbournick June 4, 2025 17:50
Copy link
Copy Markdown
Collaborator

@harbournick harbournick left a comment

Choose a reason for hiding this comment

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

LGTM

@harbournick harbournick merged commit 9e6b827 into main Jun 4, 2025
5 of 6 checks passed
@harbournick harbournick deleted the artem-spacing-v1 branch June 4, 2025 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants