| 16 | }()), |
| 17 | // translates source code from a string to an array by splitting on line breaks |
| 18 | stringAsLines = function diffview_stringAsLines(str : string): string[]{ |
| 19 | const lines = (options.diff_format === "text") |
| 20 | ? str |
| 21 | : str |
| 22 | .replace(/&/g, "&") |
| 23 | .replace(/&#lt;/g, "$#lt;") |
| 24 | .replace(/&#gt;/g, "$#gt;") |
| 25 | .replace(/</g, "$#lt;") |
| 26 | .replace(/>/g, "$#gt;"); |
| 27 | if (options.crlf === true) { |
| 28 | return lines.split("\r\n"); |
| 29 | } |
| 30 | return lines.split("\n"); |
| 31 | }, |
| 32 | // array representation of base source |
| 33 | baseTextArray: string[] = (typeof options.source === "string") |
| 34 | ? stringAsLines(options.source) |