Skip to content

Instantly share code, notes, and snippets.

@kyranjamie
Created March 12, 2024 12:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kyranjamie/84ddf83ec2901e08a3a517d3cf10b254 to your computer and use it in GitHub Desktop.
Save kyranjamie/84ddf83ec2901e08a3a517d3cf10b254 to your computer and use it in GitHub Desktop.
Script to remove all spaces from Github labels
// Super hacky script to paste into dev tools to remove spaces from github labels
[...document.querySelectorAll(".js-label-list > div")].forEach(async (el, i) => {
await new Promise((resolve) => setTimeout(resolve, 400 * i));
const edit = el.querySelector(".js-edit-label");
edit?.click();
const label = el.querySelector('[placeholder="Label name"]');
const value = label?.getAttribute("value");
const newValue = value?.replaceAll(' ', '')
console.log(newValue)
label?.setAttribute("value", newValue);
el.querySelector(".btn-primary")?.click();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment