-
-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
Description
The idea will be to allow users to define whenever they want line breaks ignored or not when creating all the selection options.
Requested by @lolergb
Some pseudo-code provided for this feature.
let inputSearch = "Byeeeee";
let changeText = "Bye";
let search = new RegExp(inputSearch, 'gi');
function changeContent(node, text) {
let font = node.fontName;
figma
.loadFontAsync(font)
.then(() => {
node.characters = text;
})
.catch((e) => {
console.info(e);
});
console.log(node.characters);
}
function myTrim(x) {
return x.replace(/\s+/g, ' ');
}
figma.currentPage.findAll((node) => {
if (node.characters && myTrim(node.characters).match(search)) {
console.log(node.characters)
//changeContent(node, changeText);
}
})