class TaskListItemBlockPreProcessor implements BlockPreProcessor {

    public TaskListItemBlockPreProcessor(DataHolder options) {
    }

    @Override
    public void preProcess(ParserState state, Block block) {<FILL_FUNCTION_BODY>}

    public static class Factory implements BlockPreProcessorFactory {
        @NotNull
        @Override
        public Set<Class<? extends Block>> getBlockTypes() {
            HashSet<Class<? extends Block>> set = new HashSet<>();
            set.add(BulletListItem.class);
            set.add(OrderedListItem.class);
            return set;
        }

        @Nullable
        @Override
        public Set<Class<?>> getAfterDependents() {
            return null;
        }

        @Nullable
        @Override
        public Set<Class<?>> getBeforeDependents() {
            return null;
        }

        @Override
        public boolean affectsGlobalScope() {
            return true;
        }

        @NotNull
        @Override
        public BlockPreProcessor apply(@NotNull ParserState state) {
            return new TaskListItemBlockPreProcessor(state.getProperties());
        }
    }
}

        if (block instanceof BulletListItem || block instanceof OrderedListItem) {
            // we chop up the previous paragraph into definition terms and add the definition item to the last one
            // we add all these to the previous DefinitionList or add a new one if there isn't one
            final ListItem listItem = (ListItem) block;

            final BasedSequence markerSuffix = listItem.getMarkerSuffix();

            if (markerSuffix.matches("[ ]") || markerSuffix.matches("[x]") || markerSuffix.matches("[X]")) {
                TaskListItem taskListItem = new TaskListItem(listItem);
                taskListItem.setTight(listItem.isOwnTight());
                listItem.insertBefore(taskListItem);
                listItem.unlink();
                state.blockAdded(taskListItem);
                state.blockRemoved(listItem);
            }
        }
    
<no_super_class>