Customizable preview
Describe your suggested feature
Able users to modify the default preview as they like.
Why
1… Preferences. Maybe they just don't like the default one.. or missing italic words, or words in double quotes etc..
2… For test purposes (for an easier testing experience).
Lets say i wanted to test multiple .replace on a string where they act on the output of the previous .replace. Pasting the initial string on the preview would make the testing way easier.
2.1 There are more complicated codes that dont cut for the easy regex replace like
chapter = document.querySelector('chapter');
function replacer(_, p, d, e) {
const nn = parseFloat(p.replace(',', '.'));
let unit = nn * 1.5;
if (unit > 10) km = Math.round(unit);
return `${unit}${d} km`;
}
chapter.innerHTML = chapter.innerHTML.replace(
/(\d+|\d+[\.\,]\d\d)( milion| bilion| [Tt]rillion)?\s[Mm]ile(s)?/g,
replacer,
);
and being able to modify a little the preview to test that code (or adding more to process the same string on multiple 'phases' like in 2.)
It would make it way easier and faster to test without the need to go to a random website and do it.
So this ables to user to test without internet and/or a pc.
Edit: Edit preview needs a "set as default"(new preview edited by the user, set as default), "reset to original default" (current[1.1.18] JS/CSS preview) and "reset" (reset to default, not the original default) buttons.
Other details
Personally, idk how to test the complicated javascripts on a string (like in 2.1) because i have no coding skills, so in these cases i just hope to find that string in a chapter of a novel and start testing it watching the result on THAT chapter after i inject the js.
This feature would help.
Acknowledgements
- [X] I have searched the existing issues and this is a new ticket, NOT a duplicate or related to another open or closed issue.
- [X] I have written a short but informative title.
- [X] If this is an issue with a source, I should be opening an issue in the sources repository.
- [X] I have updated the app to version 1.1.18.
- [X] I will fill out all of the requested information in this form.
I think so too