A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.
Read the statement by Michael Teeuw here.
MMM-CX3A - Transform not working?
-
@BKeyport
Anyway, how about this code for those who need many transforming like you?eventTransformer: (event) => { const replaceMap = { 'original': 'Replaced', 'text': 'string', 'foo': 'bar', 'baz': 'qux', } Object.keys(replaceMap).forEach((key) => { const regex = new RegExp(key, 'gi') event.title = event.title.replace(regex, (token) => { event.color = 'red' return replaceMap[ key ] }) }) return event }
-
@MMRIZE That looks interesting… Most of my transforming is yanking out the emoji, though - because electron does partial display at best, and I so hate the boxed X showing up everywhere.
-
@BKeyport
You may need to install emoji fonts
Or you can parse out non-ASCII characters with regular expressions. -
@MMRIZE Interesting. How would one install the Emoji fonts? I’d rather have the prettyness than all text.
-