src/language-yaml/utils.js/getFlowScalarLineContents
function getFlowScalarLineContents(nodeType, content, options) {
  const rawLineContents = content
    .split("\n")
    .map((lineContent, index, lineContents) =>
      index === 0 && index === lineContents.length - 1
        ? lineContent
        : index !== 0 && index !== lineContents.length - 1
        ? lineContent.trim()
        : index === 0
        ? lineContent.trimEnd()
        : lineContent.trimStart()
    );

  if (options.proseWrap === "preserve") {
    return rawLineContents.map((lineContent) =>
      lineContent.length === 0 ? [] : [lineContent]
    );
  }

  return rawLineContents
    .map((lineContent) =>
      lineContent.length === 0 ? [] : splitWithSingleSpace(lineContent)
    )
    .reduce(
      (reduced, lineContentWords, index) =>
        index !== 0 &&
        rawLineContents[index - 1].length > 0 &&
        lineContentWords.length > 0 &&
        !(
          // trailing backslash in quoteDouble should be preserved
          (
            nodeType === "quoteDouble" &&
            getLast(getLast(reduced)).endsWith("\\")
          )
        )
          ? [
              ...reduced.slice(0, -1),
              [...getLast(reduced), ...lineContentWords],
            ]
          : [...reduced, lineContentWords],
      []
    )
    .map((lineContentWords) =>
      options.proseWrap === "never"
        ? [lineContentWords.join(" ")]
        : lineContentWords
    );
}