Skip to content

Commit 4f1e40b

Browse files
Spongmanstalgiag
authored andcommitted
clean 'prettier-ignore' from examples (#3542)
1 parent bdd54c0 commit 4f1e40b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

docs/preprocessor.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ function smokeTestMethods(data) {
3030
});
3131
}
3232

33+
function cleanExamples(data) {
34+
data.classitems.forEach(function(classitem) {
35+
if (classitem.itemtype === 'method' && classitem.example) {
36+
classitem.example = classitem.example.map(i =>
37+
i.replace(/[^\n]*\/\/\s*prettier-ignore.*\r?\n/g, '')
38+
);
39+
}
40+
});
41+
}
42+
3343
function mergeOverloadedMethods(data) {
3444
var methodsByFullName = {};
3545
var paramsForOverloadedMethods = {};
@@ -248,6 +258,7 @@ module.exports = function(data, options) {
248258
renderDescriptionsAsMarkdown(data);
249259
mergeOverloadedMethods(data);
250260
smokeTestMethods(data);
261+
cleanExamples(data);
251262
};
252263

253264
module.exports.mergeOverloadedMethods = mergeOverloadedMethods;

0 commit comments

Comments
 (0)