Small fixes
A selection of 80 fixes from 174 pull requests.
42.Folded YAML paragraphs
YAML folding added an extra paragraph newline and turned breaks around indented passages into spaces. Track blank lines and indentation when choosing each separator.
1234123456789101112131415161718819 for (let index = 0; index < content.length; index++) { output += content[index] if (index < content.length - 1) { output += content[index].length === 0 || content[index + 1].length === 0 ? "\n" : " " let blankLines = 0 let previousMoreIndented: boolean | undefined for (const line of content) { if (line.length === 0) { blankLines++ } else { const moreIndented = line.startsWith(" ") const hardBreak = moreIndented || previousMoreIndented === true if (previousMoreIndented === undefined) output += "\n".repeat(blankLines) else if (blankLines === 0) output += hardBreak ? "\n" : " " else output += "\n".repeat(blankLines + (hardBreak ? 1 : 0)) output += line blankLines = 0 previousMoreIndented = moreIndented } } output += "\n".repeat(blankLines)}if (chomp === "keep") return `${output}\n`if (chomp === "keep") return output.endsWith("\n") ? output : `${output}\n`