Email links broken



  • I wanted to include a link to the room history in my mails, and did the following:

    warning += "\n<a href=\"https://screeps.com/a/#!/history/"+room.name+"?t="+Game.time+"\">Room History</a>";
    Game.notify(warning,0);

    This should work, however, the room.name breaks the link, because it's automatically converted into a link, ripping my href attribute apart.

    Escaping the room names like following works, but is not really nice:

    let roomName = room.name.replace(/^\w/,"&#"+room.name.charCodeAt(0)+";")

    Can you please disable the automatic parsing and linking of the roomnames?

    👍

  • Dev Team

    Automatic room linking is a convenient feature which is useful to many our users. Disabling it just because of one edge case would not be a wise decision.

    👎


  • I agree, but it should not be linked to the room name but rather to the Room.toString() representation.

    E.g. if you use "room" (resulting in [room roomname]) in your message, it will create a link, but not "room.name". This makes it possible to manually construct links includung the room names, but still maintain the handy room links.



  • how about adding a flag to Game.notify to not do that?

    Game.notify(warning, 0, true) to "skip automatic parsing" or something like that?



  • I would really like this to be fixed. As others have suggested, it would still work conveniently if it was linked to the room.toString representation, but would allow us to easily avoid the auto-linking if we don't want it.

    @artch, at the very least, if this really isn't going to be fixed please could you point us in the direction of the source code which does this so we can create the best workaround possible. Thanks.