Skip to content

Commit f1e213e

Browse files
authored
Fix minor issues with the code samples and the IDL
1 parent 2870e45 commit f1e213e

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ When there are multiple languages in the proofreading input, developers could sp
100100
const proofreader = await Proofreader.create({
101101
includeCorrectionTypes: true,
102102
expectedInputLanguages: ["en", "ja"],
103-
})
103+
});
104104
```
105105

106106
### Testing available options before creation
@@ -148,7 +148,7 @@ const proofreader = await Proofreader.create({
148148
console.log(`Downloaded ${e.loaded * 100}%`);
149149
});
150150
}
151-
};
151+
});
152152
```
153153

154154
If the download fails, then `downloadprogress` events will stop being fired, and the promise returned by `create()` will be rejected with a "`NetworkError`" `DOMException`.
@@ -177,15 +177,13 @@ Allowing such destruction provides a way to free up the memory used by the langu
177177

178178
Aborting the creation process will reject the promise returned by `create()`, and will also stop signaling any ongoing download progress. (The browser may then abort the downloads, or may continue them. Either way, no further `downloadprogress` events will be fired.)
179179

180-
181-
182180
## Detailed design discussion
183181

184182
### Proofreading correction output
185183

186184
For each input, the method `proofread()` returns a promise of `ProofreadResult`:
187185

188-
```js
186+
```idl
189187
dictionary ProofreadResult {
190188
DOMString corrected;
191189
sequence<ProofreadCorrection> corrections;
@@ -194,7 +192,7 @@ dictionary ProofreadResult {
194192

195193
`corrected` is the fully corrected version of the input, while `corrections` contains a list of corrections made, their locations in the original input (e.g. so web developers can create UI to highlight the error), and optionally labels/explanations.
196194

197-
```js
195+
```idl
198196
dictionary ProofreadCorrection {
199197
unsigned long long startIndex;
200198
unsigned long long endIndex;
@@ -241,7 +239,7 @@ if (inputRenderIndex !== input.length){
241239
```
242240

243241
### Full API surface in Web IDL
244-
```js
242+
```idl
245243
[Exposed=(Window,Worker), SecureContext]
246244
interface Proofreader {
247245
static Promise<Proofreader> create(optional ProofreaderCreateOptions options = {});

0 commit comments

Comments
 (0)