Add a tagged template function for HTML supporting HTML interpolation.

This allows better Prettier integration: Prettier recognizes and
reformats tagged template literals with a tag named ‘html’.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2021-03-31 18:43:14 -07:00
parent 2c40843306
commit ce9a680333
17 changed files with 116 additions and 86 deletions

View File

@@ -1,8 +1,8 @@
import {ipcRenderer} from 'electron';
import * as backoff from 'backoff';
import {htmlEscape} from 'escape-goat';
import {html} from '../../../common/html';
import Logger from '../../../common/logger-util';
import type WebView from '../components/webview';
@@ -60,9 +60,10 @@ export default class ReconnectUtil {
logger.log('There is no internet connection, try checking network cables, modem and router.');
const errorMessageHolder = document.querySelector('#description');
if (errorMessageHolder) {
errorMessageHolder.innerHTML = htmlEscape`
errorMessageHolder.innerHTML = html`
<div>Your internet connection doesn't seem to work properly!</div>
<div>Verify that it works and then click try again.</div>`;
<div>Verify that it works and then click try again.</div>
`.html;
}
return false;