Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
Sartxi committed Jun 18, 2024
1 parent 76d18a9 commit d4a6ce6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libs/blocks/locui/loc/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ async function loadProjectSettings(projSettings) {
function sanitize(url) {
const hlxUrl = /^https?:\/\/[^/?#]+/g;
const [hostname] = url.match(hlxUrl);
const sanitized = hostname.replaceAll('–', '--');
const newURL = url.replace(hlxUrl, sanitized);
const enDash = hostname.replaceAll('–', '--');
const newURL = url.replace(hlxUrl, enDash);
return new URL(newURL);
}

Expand All @@ -110,7 +110,7 @@ async function loadDetails() {
try {
const resp = await fetch(previewPath);
const json = await resp.json();
const jsonUrls = json.urls.data.map((item) => sanitize(item.URL));
const jsonUrls = json.urls.data.map(({ URL }) => sanitize(URL));
const projectUrls = getUrls(jsonUrls);
const projectLangs = json.languages.data.reduce((rdx, lang) => {
if (LANG_ACTIONS.includes(lang.Action)) {
Expand Down

0 comments on commit d4a6ce6

Please sign in to comment.