Skip to content

Commit 89a5291

Browse files
authored
Merge pull request #19360 from Yoast/PC-976-adapt-inclusive-language-shortlinks-for-shopify
Adds the possibility to add options to the Inclusive language assessor.
2 parents 98e2dd2 + 5316a8e commit 89a5291

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

packages/yoastseo/src/worker/AnalysisWebWorker.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ export default class AnalysisWebWorker {
8080

8181
this.additionalAssessors = {};
8282

83+
this._inclusiveLanguageOptions = {};
84+
8385
/*
8486
* The cached analyses results.
8587
*
@@ -133,6 +135,7 @@ export default class AnalysisWebWorker {
133135
this.setCustomCornerstoneRelatedKeywordAssessorClass = this.setCustomCornerstoneRelatedKeywordAssessorClass.bind( this );
134136
this.registerAssessor = this.registerAssessor.bind( this );
135137
this.registerResearch = this.registerResearch.bind( this );
138+
this.setInclusiveLanguageOptions = this.setInclusiveLanguageOptions.bind( this );
136139

137140
// Bind event handlers to this scope.
138141
this.handleMessage = this.handleMessage.bind( this );
@@ -260,6 +263,17 @@ export default class AnalysisWebWorker {
260263
this._relatedKeywordAssessor = this.createRelatedKeywordsAssessor();
261264
}
262265

266+
/**
267+
* Sets the options to use for the Inclusive language analysis.
268+
*
269+
* @param {{infoLinks: {}}} options The options to use.
270+
*
271+
* @returns {void}
272+
*/
273+
setInclusiveLanguageOptions( options ) {
274+
this._inclusiveLanguageOptions = options;
275+
}
276+
263277
/**
264278
* Sets up the web worker for running the tree readability and SEO analysis.
265279
*
@@ -531,7 +545,7 @@ export default class AnalysisWebWorker {
531545
return null;
532546
}
533547

534-
return new InclusiveLanguageAssessor( this._researcher );
548+
return new InclusiveLanguageAssessor( this._researcher, this._inclusiveLanguageOptions );
535549
}
536550

537551

0 commit comments

Comments
 (0)