Document xterm HTML structure dependency in trimHtmlOutput
Add warning about dependency on xterm's HTML format and the risk if xterm changes it. Suggest filing an upstream issue for a native trimEmpty option.
This commit is contained in:
parent
4502be8d06
commit
f2a60658cf
1 changed files with 10 additions and 1 deletions
|
|
@ -46,7 +46,16 @@ export function serializeAsHTML(session: TerminalSession): string {
|
|||
/**
|
||||
* Trim empty trailing rows and trailing whitespace from xterm HTML output.
|
||||
*
|
||||
* Structure: <html><body><!--StartFragment--><pre><div style='...'><div><span>...</span></div>...</div></pre><!--EndFragment--></body></html>
|
||||
* WARNING: This function depends on xterm's specific HTML structure from serializeAsHTML().
|
||||
* If xterm changes their HTML format, this will need updating. Consider filing an issue
|
||||
* with xterm to add a native trimEmpty option.
|
||||
*
|
||||
* Current structure expected:
|
||||
* - Outer: <pre class="xterm-screen">
|
||||
* - Rows: <div style="..."><div><span>content</span></div></div>
|
||||
* - Empty cells: or plain spaces
|
||||
*
|
||||
* Full structure: <html><body><!--StartFragment--><pre><div style='...'><div><span>...</span></div>...</div></pre><!--EndFragment--></body></html>
|
||||
* Each row is: <div><span>content</span></div>
|
||||
*/
|
||||
function trimHtmlOutput(html: string): string {
|
||||
|
|
|
|||
Loading…
Reference in a new issue