Skip to content

Commit

Permalink
Fixes reported issue
Browse files Browse the repository at this point in the history
  • Loading branch information
walmazacn committed Oct 7, 2024
1 parent a98767f commit 4c7c460
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions website/docs/src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,17 @@

<script type="text/javascript">
const sanitizeString = function(input) {
return input ? input.replace(/[^a-z0-9-]/gim, '').toLowerCase() : '';
return input ? input.replace(/[^a-z0-9-/]/gim, '').toLowerCase() : '';
};
const locationPath = sanitizeString(location.pathname);
const pathNameIndex = locationPath.lastIndexOf('/') + 1;

// Import LuigiClient into each microfrontend
let script = document.createElement('script');
script.type = 'text/javascript';
script.src = '/luigi-client/luigi-client.js';
document.getElementsByTagName('body')[0].appendChild(script);
document.body.classList.add(
'page-' +
sanitizeString(
location.pathname.substring(location.pathname.lastIndexOf('/') + 1)
)
);
document.body.classList.add('page-' + locationPath.substring(pathNameIndex));

// Modify WC API docu labels manually for added clarity through title attribute
document.addEventListener('DOMContentLoaded', function() {
Expand Down

0 comments on commit 4c7c460

Please sign in to comment.