import * as util from 'util' ; import { BaseView } from './baseview' ; import { WebviewPanel } from 'vscode' ; import { Utility } from '../misc/utility' ; /**
 * A Webview that just shows some static text.
 * Is e.g. used to run an Emulator command and display it's output.
 */ export class TextView extends BaseView { param title param text constructor ( title , text ) { super ( ) ; Utility . assert ( this . vscodePanel ) ; ( this . vscodePanel as WebviewPanel ) . title = title ; this . setHtml ( text ) ; } param text protected setHtml ( text ) { const format = `<!DOCTYPE html>
		<html lang="en">
		<head>
			<meta charset="UTF-8">
			<meta name="viewport" content="width=device-width, initial-scale=1.0">
			<title>Dump</title>
		</head>

		<body style="font-family: Courier">

		<div style="word-wrap:break-word">

%s

		</div>

		</body>

		</html>` ; const brText = text . replace ( /\n/g , '<br>' ) ; const html = util . format ( format , brText ) ; this . vscodePanel . webview . html = html ; } }