format(format) {
    const openedTags = [];
    const marker = htmlEscape(MARKER);
    const html = htmlEscape(format).replace(
        new RegExp(`\\{${marker}[\\w&#;]+\\}`, 'g'),
        goog.bind(this.replaceFormattingString_, this, openedTags));
    assert(
        openedTags.length == 0,
        'Expected no unclosed tags, got <' + openedTags.join('>, <') + '>.');
    return SafeHtml.createSafeHtmlSecurityPrivateDoNotAccessOrElse(html);
  }
Formats a plain text string with markers holding HTML fragments to
SafeHtml.
@param {string} format Plain text format, will be HTML-escaped.
@return {!SafeHtml}