private void filterForLines(Document document, PreprocessorReader reader, String target,
                                    Path includee, String includeeText, Map<String, Object> attributes) {
          List<Range> lineRanges = determineLineRangesToFilterFor(attributes);
          if (lineRanges == null) {
            // do not include anything if an invalid line range was found
            return;
          }

          // if no line ranges are configured, include the whole file if it has any content
          if (lineRanges.isEmpty()) {
            if (!includeeText.isEmpty()) {
              pushMarkedInclude(document, reader, target, new StringBuilder(includeeText), 1, includee, attributes);
            }
            return;
          }

          StringBuilder includedText = new StringBuilder();
          int[] firstLine = {0};
          int[] lineNumber = {0};

          includeeText.lines().forEachOrdered(line -> {
            lineNumber[0]++;
            // include a line, if it is contained in any of the configured ranges
            if (lineRanges.stream().anyMatch(lineRange -> lineRange.contains(lineNumber[0]))) {
              if (firstLine[0] == 0) {
                // record the first included line number
                firstLine[0] = lineNumber[0];
              }
              includedText.append(line).append('\n');
            }
          });

          // include matched lines, if there were any in the configured ranges
          if (firstLine[0] != 0) {
            pushMarkedInclude(document, reader, target, includedText, firstLine[0], includee, attributes);
          }
        }
Filter the includee's text for the specified line ranges and push the result.

@param document The currently rendered document
@param reader The current reader
@param target The target of the include directive, i.e. the included file starting with {@code ../}
@param includee The resolved includee
@param includeeText The text of the includee
@param attributes The attributes used on the include directive
build-logic/asciidoc-extensions/src/main/java/org/spockframework/plugins/asciidoctor/IncludedSourceLinker.java