code: function trimMention(person, message) {
  
      // If the message does not contain HTML, no need parsing it for Mentions
      if (!message.html) {
          return message.text;
      }
  
      var buffer = "";
      var skip = 0;
      var group = 0;      
      var parser = new htmlparser.Parser({
          onopentag: function(tagname, attribs){
              fine("opening brace name: " + tagname + ", with args: " + JSON.stringify(attribs));
              if (tagname === "spark-mention") {
                  if (attribs["data-object-type"]=="person" && attribs["data-object-id"]== person.id ) {
                          skip++; // to skip next text as bot was mentionned
                  }
  
                  // [Workaround] for Mac clients, see issue https://github.com/CiscoDevNet/node-sparkbot/issues/1
                  if (attribs["data-object-type"]=="person" && attribs["data-object-id"]== person.rawId ) {
                          skip++; // to skip next text as bot was mentionned
                  }
              }
          },
          ontext: function(text){
              if (!skip) {
                  fine("appending: " + text);
                  if (group > 0) {
                      buffer += " ";
                  }
                  buffer += text.trim();
                  group++;
              }
              else {
                  skip--; // skipped, let's continue HTML parsing in case other bot mentions appear
                  group = 0;
              }
          },
          onclosetag: function(tagname){
               fine("closing brace name: " + tagname);
          }
      }, {decodeEntities: true});
      parser.parseComplete(message.html);
  
      debug("trimed: " + buffer);
      return buffer;
  }
docs: Return a string in which webhook mentions are removed Note : we need to start from the HTML text as it only includes mentions for sure. In practice, the plain text message may include a nickname