support style changes in revisions
This commit is contained in:
@ -53,9 +53,21 @@ In addition to marking text as inserted or deleted, change tracking can also be
|
||||
```ts
|
||||
import { Document } from "docx";
|
||||
|
||||
const doc = new Document({
|
||||
features: {
|
||||
trackRevisions: true,
|
||||
},
|
||||
});
|
||||
const doc = new Document({});
|
||||
doc.Settings.addTrackRevisions()
|
||||
```
|
||||
|
||||
If you want to express a style changes, you can add a `revision` to a `TextRun` which need to include all previous style attributes.
|
||||
|
||||
```ts
|
||||
new TextRun({
|
||||
bold: true,
|
||||
text: "This text is now bold and was previously not",
|
||||
revision: {
|
||||
id: 1,
|
||||
author: "Firstname Lastname",
|
||||
date: "2020-10-06T09:05:00Z",
|
||||
bold: false,
|
||||
}
|
||||
}).break()
|
||||
````
|
||||
|
Reference in New Issue
Block a user