| 887 | } |
| 888 | |
| 889 | private scanCodeFence() { |
| 890 | // skip to the end of this line first |
| 891 | const fenceStart = this.scanUntil((ch, chNext) => ch === CharacterCodes.lineFeed || (ch === CharacterCodes.carriageReturn && chNext === CharacterCodes.lineFeed)); |
| 892 | |
| 893 | // end when the first column is triple backtick |
| 894 | const code = this.scanUntil((ch, chNext, chNextNext) => this.#column === 0 && (ch === CharacterCodes.backtick && chNext === CharacterCodes.backtick && chNextNext === CharacterCodes.backtick)); |
| 895 | |
| 896 | this.text = fenceStart + code; |
| 897 | |
| 898 | // code is just the inside contents |
| 899 | this.stringValue = code.substring(0, code.length - 3); |
| 900 | |
| 901 | return this.kind = Kind.CodeFence; |
| 902 | } |
| 903 | |
| 904 | private unescapeString(text: string) { |
| 905 | let result = ''; |