Skip to content

Commit e3cb78b

Browse files
committed
Switching to Text.replaceAll
1 parent eb52d8f commit e3cb78b

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

apps/api-documenter/src/yaml/OfficeYamlDocumenter.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { DocItemSet } from '../utils/DocItemSet';
1010
import { IYamlTocItem } from './IYamlTocFile';
1111
import { IYamlItem } from './IYamlApiFile';
1212
import { YamlDocumenter } from './YamlDocumenter';
13+
import { Text } from '@microsoft/node-core-library';
1314

1415
interface ISnippetsFile {
1516
/**
@@ -128,18 +129,10 @@ export class OfficeYamlDocumenter extends YamlDocumenter {
128129
}
129130

130131
private _fixBoldAndItalics(text: string): string {
131-
while (text.indexOf('\\*') >= 0) {
132-
text = text.replace('\\*', '*');
133-
}
134-
135-
return text;
132+
return Text.replaceAll(text, '\\*', '*');
136133
}
137134

138135
private _fixCodeTicks(text: string): string {
139-
while (text.indexOf('\\`') >= 0) {
140-
text = text.replace('\\`', '`');
141-
}
142-
143-
return text;
136+
return Text.replaceAll(text, '\\`', '`');
144137
}
145138
}

0 commit comments

Comments
 (0)