Skip to content

Commit

Permalink
Merge pull request #171 from Rias500/patch-2
Browse files Browse the repository at this point in the history
Trim title for whitespace
  • Loading branch information
Tam authored Jan 21, 2019
2 parents 8d585e8 + b64097e commit 182dd94
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions resources/js/field/KeywordChecklist.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export default class KeywordChecklist {
* Judge the length of the title
*/
judgeTitleLength () {
const l = this.SEO.snippetFields.title.textContent.length;
const l = this.SEO.snippetFields.title.textContent.trim().length;

this.addRating(
l < 40 || l > 60 ? SEO_RATING.POOR : SEO_RATING.GOOD,
Expand All @@ -215,7 +215,7 @@ export default class KeywordChecklist {
* Judge the positioning of the keyword in the title
*/
judgeTitleKeyword () {
const title = this.SEO.snippetFields.title.textContent;
const title = this.SEO.snippetFields.title.textContent.trim();
const index = title.toLowerCase().indexOf(this.keywordLower);

if (index > -1) {
Expand Down

0 comments on commit 182dd94

Please sign in to comment.