(input: Array<string>)
| 128 | // * text has more than one adjacent line |
| 129 | // * markup does not close |
| 130 | export const dedentLines = (input: Array<string>): Array<string> | null => { |
| 131 | const output: Array<string> = []; |
| 132 | |
| 133 | while (output.length < input.length) { |
| 134 | const line = input[output.length]; |
| 135 | |
| 136 | if (hasUnmatchedDoubleQuoteMarks(line)) { |
| 137 | return null; |
| 138 | } else if (isFirstLineOfTag(line)) { |
| 139 | if (!dedentMarkup(input, output)) { |
| 140 | return null; |
| 141 | } |
| 142 | } else { |
| 143 | output.push(dedentLine(line)); |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | return output; |
| 148 | }; |
no test coverage detected