MagicMirror² v2.14.0 is available! For more information about this release, check out this topic.

default compliments

  • hey guys, is there any way to insert HTML tags in a remote JSON file for copliments default module?
    < font color=‘red’ >hello sweety< font >


  • @MrDondoT said in default compliments:

    < font color=‘red’ >hello sweety< font >

    It is possible but you need to change the current module code as well, right now it is creating text node but to support html text code needs to be changed as below

    for (var part of parts) {
    			// create a text element for each part
    			//compliment.appendChild(document.createTextNode(part)); //Comment this line
    			compliment.innerHTML += part;  //Add this line
    			// add a break `

    Result should be as below if your compliments are like below

    evening: ["Wow, you look hot!", "You look nice!", "Hi, <i>sexy!</i>","< font color='red'>hello sweety< /font>"],




  • @ashishtank fantastic! that’s correct. Thanks

Log in to reply