private LinkedHashMap<String, Boolean> determineTagsToFilterFor(Map<String, Object> attributes) {
          LinkedHashMap<String, Boolean> result = new LinkedHashMap<>();

          if (attributes.containsKey("tag")) {
            // tag attribute was found, tags will be ignored
            Object tagValue = attributes.get("tag");
            if (tagValue != null) {
              String tag = tagValue.toString();
              if (!tag.isEmpty() && !"!".equals(tag)) {
                // if actually a tag is configured and is not equal to "!", filter for it
                if (tag.charAt(0) == '!') {
                  result.put(tag.substring(1), false);
                } else {
                  result.put(tag, true);
                }
              }
            }
          } else if (attributes.containsKey("tags")) {
            // tag was not found, so use tags value
            Object tagsValue = attributes.get("tags");
            if (tagsValue != null) {
              splitList(tagsValue.toString())
                .forEachOrdered(tag -> {
                  if (!tag.isEmpty() && !"!".equals(tag)) {
                    // if actually a tag is configured and is not equal to "!", filter for it
                    if (tag.charAt(0) == '!') {
                      result.put(tag.substring(1), false);
                    } else {
                      result.put(tag, true);
                    }
                  }
                });
            }
          }

          return result;
        }
Determine the tags to filter for from the attributes.
To be consistent with the Asciidoctor built-in logic, a {@code tag} attribute wins alone
and {@code tags} is ignored even if present additionally.
If {@code tag} is not found, {@code tags} is used, split at commas and semicolons
without considering surrounding whitespace which stay part of the tag name even if never matching anything.
If neither {@code tag} nor {@code tags} is found, the result will be an empty list which results
in the whole file being included.

@param attributes The attributes to extract the tag configuration from
@return The tags to filter the included file for
build-logic/asciidoc-extensions/src/main/java/org/spockframework/plugins/asciidoctor/IncludedSourceLinker.java