replaceFormattingString_(openedTags, match) {
    const replacement = this.replacements_[match];
    if (!replacement) {
      // Someone included a string looking like our internal marker in the
      // format.
      return match;
    }
    let result = '';
    if (replacement.startTag) {
      result += '<' + replacement.startTag + replacement.attributes + '>';
      if (ENABLE_ASSERTS) {
        if (!isVoidTag(replacement.startTag.toLowerCase())) {
          openedTags.push(replacement.startTag.toLowerCase());
        }
      }
    }
    if (replacement.html) {
      result += replacement.html;
    }
    if (replacement.endTag) {
      result += '</' + replacement.endTag + '>';
      if (ENABLE_ASSERTS) {
        const lastTag = openedTags.pop();
        assert(
            lastTag == replacement.endTag.toLowerCase(),
            `Expected </${lastTag}>, got </` + replacement.endTag + '>.');
      }
    }
    return result;
  }
Replaces found formatting strings with saved tags.
@param {!Array<string>} openedTags The tags opened so far, modified by this
    function.
@param {string} match
@return {string}
@private