Wrap HTML lines in document.writeln calls or store them in a string array. The reverse action reads supported writeln calls and reconstructs their text, including the newline each call adds.
Runs locally in your browserUse the three actions to prepare line-based strings for existing JavaScript code or recover text from literal document.writeln calls. The converter processes the input in browser JavaScript and displays code as plain text.
Forward conversion normalizes CRLF and CR line endings to LF and creates a call for each line, including a final empty line. Input A therefore writes A followed by LF. Input A followed by LF generates two calls and writes A followed by two LF characters.
The reverse action reconstructs the text passed to the document stream, not the original source layout. Blank lines between JS statements do not add output. An empty JS input returns empty text; document.writeln("") returns one LF. A string array does not add newlines to its entries; joining it with \n recovers the normalized input.
The parser accepts direct document.writeln calls with exactly one single- or double-quoted string argument. It decodes JavaScript string escapes without evaluating the program. Whitespace and comments between calls are allowed.
Variables, concatenation, template literals, arrays, document.write, computed property access and other expressions are rejected. Remove surrounding script tags before using the reverse action. HTML entities such as & remain literal text.
Quotes, backslashes and control characters are escaped for JavaScript. Escaping < also prevents a literal closing script tag in the generated source, but the decoded HTML still contains its original tags and attributes.
The tool neither sanitizes nor validates HTML. If you execute the snippet elsewhere, document.writeln can insert active HTML and may replace a loaded document. This legacy API is not recommended for new DOM code. Conversion here does not run the snippet or send the input in a conversion request.
No. It only reconstructs direct document.writeln calls containing one quoted string. It does not run functions, fetch data or evaluate expressions.
Yes. O'Reilly and C:\temp retain their characters as string values. Each input line becomes an array entry, including empty lines; original CRLF or CR endings are normalized to LF.