-
Notifications
You must be signed in to change notification settings - Fork 126
HAR-9211 Comments export fixes #414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1604,11 +1604,14 @@ function translateFieldAnnotation(params) { | |
|
|
||
| export function translateHardBreak() { | ||
| return { | ||
| name: 'w:br', | ||
| type: 'element', | ||
| attributes: { 'w:type': 'page' } | ||
| name: 'w:r', | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @harbournick When Word recovers our documents it wraps hard breaks into run for some reason |
||
| elements: [{ | ||
| name: 'w:br', | ||
| type: 'element', | ||
| attributes: { 'w:type': 'page' } | ||
| }] | ||
| }; | ||
| }; | ||
| } | ||
|
|
||
| export class DocxExporter { | ||
| constructor(converter) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,11 +38,14 @@ export function translateCommentNode(params, type) { | |
|
|
||
| let commentSchema = getCommentSchema(type, commentIndex); | ||
| if (type === 'End') { | ||
| const commentReference = { name: 'w:commentReference', attributes: { 'w:id': String(commentIndex) } }; | ||
| const commentReference = { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @harbournick Same with wrapping here |
||
| name: 'w:r', | ||
| elements: [{ name: 'w:commentReference', attributes: { 'w:id': String(commentIndex) } }] | ||
| }; | ||
| commentSchema = [commentSchema, commentReference]; | ||
| }; | ||
| } | ||
| return commentSchema; | ||
| }; | ||
| } | ||
|
|
||
|
|
||
| /** | ||
|
|
@@ -185,15 +188,14 @@ export const updateCommentsExtendedXml = (comments = [], commentsExtendedXml) => | |
| const attributes = { | ||
| 'w15:paraId': comment.commentParaId, | ||
| 'w15:done': comment.resolvedTime ? '1' : '0', | ||
| 'w:rsid': comment.commentId || comment.importedId, | ||
|
harbournick marked this conversation as resolved.
|
||
| }; | ||
|
|
||
| const parentId = comment.parentCommentId; | ||
| if (parentId) { | ||
| const parentComment = comments.find((c) => c.commentId === parentId); | ||
| const parentParaId = parentComment.commentParaId; | ||
| attributes['w15:paraIdParent'] = parentParaId; | ||
| }; | ||
| } | ||
|
|
||
| return { | ||
| type: 'element', | ||
|
|
@@ -240,7 +242,7 @@ export const updateCommentsIdsAndExtensible = (comments = [], commentsIds, exten | |
| "name": "w16cex:commentExtensible", | ||
| "attributes": { | ||
| "w16cex:durableId": newDurableId, | ||
| "w16cex:dateUtc": "2025-03-06T23:32:00Z" | ||
| "w16cex:dateUtc": toIsoNoFractional() | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not sure it has to be hardcoded
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh yeah, that was my mistake. thanks for fixing! |
||
| } | ||
| }; | ||
| extensibleUpdated.elements[0].elements.push(newExtensible); | ||
|
|
@@ -353,8 +355,8 @@ export const prepareCommentsXmlFilesForExport = ({ | |
| if (exportType === 'clean') { | ||
| const documentXml = removeCommentsFilesFromConvertedXml(convertedXml); | ||
| return { documentXml, relationships }; | ||
| }; | ||
|
|
||
| } | ||
| // Initialize comments files with empty content | ||
| const updatedXml = generateConvertedXmlWithCommentFiles(convertedXml); | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.