Skip to content

Commit

Permalink
MWPW-129907 Blog Tags
Browse files Browse the repository at this point in the history
This fixes a bug where Blog tags were getting stripped down to the point they no longer matched what was listed in the related taxonomy file. Causing tags to not render on the page.

Resolves: MWPW-129907
  • Loading branch information
Ryan Clayton committed May 23, 2023
1 parent 1cc68d2 commit d7d35fd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions libs/blocks/tags/tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { getTaxonomyModule, loadTaxonomy, computeTaxonomyFromTopics, getLinkForT
import { createTag } from '../../utils/utils.js';

export default async function init(blockEl) {
let tags = blockEl.firstElementChild?.firstElementChild?.textContent;
const tags = blockEl.firstElementChild?.firstElementChild?.textContent;

if (!tags) return;

Expand All @@ -11,7 +11,6 @@ export default async function init(blockEl) {
}

blockEl.innerHTML = '';
tags = tags.replace(/[^a-zA-Z0-9,\s-]/g, '');
const tagsArray = tags.split(', ').map((tag) => tag.trim());
const articleTax = computeTaxonomyFromTopics(tagsArray);
const tagsWrapper = createTag('p');
Expand Down

0 comments on commit d7d35fd

Please sign in to comment.