private static int countNewlines(@NotNull List<? extends InlineChunk> words) {
    int count = 0;
    for (InlineChunk word : words) {
      if (word instanceof NewlineChunk) count++;
    }
    return count;
  }
private static int countNewlines(@NotNull List<? extends InlineChunk> words)