fix(tracked-changes): preserve format on export and import#2362
fix(tracked-changes): preserve format on export and import#2362
Conversation
palmer-cl
commented
Mar 11, 2026
- Preserve formatting changes on export
- Add tests for multiple types of format preservation
|
Status: FAIL The core structural changes look correct — wrapping 1.
// helpers.js
'w:authorEmail': trackStyleMark.attrs.authorEmail,
// r-translator.test.js
expect(runPropertyChange?.attributes).toMatchObject({
'w:authorEmail': 'reviewer@example.com',
...
});Per §17.13.5.31, 2.
expect(sizeNode?.attributes?.['w:val']).toBe(24); // numberBut the input fixture in { name: 'w:sz', attributes: { 'w:val': '24' } }
|
caio-pizzol
left a comment
There was a problem hiding this comment.
@colep approach is clean, no major issues.
two small DX suggestions inline — nothing blocking.
on tests: would be good to add coverage for (1) a text node with only a trackFormat mark and no other formatting, and (2) a run that already has a w:rPrChange surviving through replaceRunProps. both cover branches that would silently break without a test catching it. left inline comments.
packages/super-editor/src/core/super-converter/v3/handlers/helpers.js
Outdated
Show resolved
Hide resolved
| if (runPropertiesNode) { | ||
| if (!Array.isArray(runPropertiesNode.elements)) runPropertiesNode.elements = []; | ||
|
|
||
| const existingChangeKeys = new Set( |
There was a problem hiding this comment.
the dedup logic here can't actually trigger — the template never contains w:rPrChange nodes, so the Set is always empty. could just append directly without the key check.
There was a problem hiding this comment.
Would the preserved changes ever have duplicates we need to account for? or safe to just put them all in?