Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1078,5 +1078,5 @@
}
],
"marker": "{/* GENERATED FILE: DO NOT EDIT. Regenerate via `pnpm run docapi:sync`. */}",
"sourceHash": "2cba047f028916729fa2c6c33b90070023085a295522e2097a916cdc90634096"
"sourceHash": "5f439c4117bbb2e55f227e7711df415c1173f8c476954c6e412a4b8b45edd1a3"
}
9 changes: 6 additions & 3 deletions apps/docs/document-api/reference/format/apply.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ Returns a TextMutationReceipt confirming inline styles were applied to the targe
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `failure` | object | yes | |
| `failure.code` | enum | yes | `"INVALID_TARGET"` |
| `failure.code` | enum | yes | `"INVALID_TARGET"`, `"NO_OP"` |
| `failure.details` | any | no | |
| `failure.message` | string | yes | |
| `resolution` | TextMutationResolution | yes | TextMutationResolution |
Expand Down Expand Up @@ -293,6 +293,7 @@ Returns a TextMutationReceipt confirming inline styles were applied to the targe
## Non-applied failure codes

- `INVALID_TARGET`
- `NO_OP`

## Raw schemas

Expand Down Expand Up @@ -1974,7 +1975,8 @@ Returns a TextMutationReceipt confirming inline styles were applied to the targe
"properties": {
"code": {
"enum": [
"INVALID_TARGET"
"INVALID_TARGET",
"NO_OP"
]
},
"details": {},
Expand Down Expand Up @@ -2025,7 +2027,8 @@ Returns a TextMutationReceipt confirming inline styles were applied to the targe
"properties": {
"code": {
"enum": [
"INVALID_TARGET"
"INVALID_TARGET",
"NO_OP"
]
},
"details": {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -701,9 +701,11 @@ export class DocxExporter {
let { name } = node;
const { elements, attributes } = node;

// Normalize w:delInstrText → w:instrText only when the field instruction is
// no longer inside a surviving w:del wrapper. Inside w:del, ECMA-376 expects
// w:delInstrText to remain intact.
// Normalize w:delInstrText → w:instrText. During import, w:del wrappers around
// field character runs lose their trackDelete marks (only text content gets marked),
// so on export the w:del wrapper is absent. Per ECMA-376 §17.16.13, w:delInstrText
// outside w:del is non-conformant — renaming to w:instrText keeps the field valid.
// Inside a surviving w:del wrapper, ECMA-376 expects w:delInstrText to remain intact.
if (name === 'w:delInstrText' && !insideDeletion) {
name = 'w:instrText';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ describe('DocxExporter', () => {
elements: [
{
name: 'w:del',
attributes: { 'w:id': '1' },
attributes: { 'w:id': '1544' },
elements: [
{
name: 'w:r',
Expand All @@ -523,7 +523,7 @@ describe('DocxExporter', () => {
elements: [
{
type: 'text',
text: ' PAGE \\\\* MERGEFORMAT ',
text: ' PAGE \\\\* MERGEFORMAT ',
},
],
},
Expand All @@ -536,9 +536,10 @@ describe('DocxExporter', () => {

const xml = exporter.schemaToXml(data);

expect(xml).toContain('<w:del ');
expect(xml).toContain('<w:delInstrText');
expect(xml).not.toContain('<w:instrText');
expect(xml).toContain('PAGE');
expect(xml).toContain('PAGE \\\\* MERGEFORMAT');
});

it('handles special characters along with [[sdspace]] placeholders', () => {
Expand Down
Loading