class AnchorLinkNodePostProcessor extends NodePostProcessor {
    final private AnchorLinkOptions options;

    public AnchorLinkNodePostProcessor(DataHolder options) {
        this.options = new AnchorLinkOptions(options);
    }

    @Override
    public void process(@NotNull NodeTracker state, @NotNull Node node) {<FILL_FUNCTION_BODY>}

    public static class Factory extends NodePostProcessorFactory {
        public Factory(DataHolder options) {
            super(false);

            if (ANCHORLINKS_NO_BLOCK_QUOTE.get(options)) {
                addNodeWithExclusions(Heading.class, BlockQuote.class);
            } else {
                addNodes(Heading.class);
            }
        }

        @NotNull
        @Override
        public NodePostProcessor apply(@NotNull Document document) {
            return new AnchorLinkNodePostProcessor(document);
        }
    }
}

        if (node instanceof Heading) {
            Heading heading = (Heading) node;
            if (heading.getText().isNotNull()) {
                Node anchor = new AnchorLink();

                if (!options.wrapText) {
                    if (heading.getFirstChild() == null) {
                        anchor.setChars(heading.getText().subSequence(0, 0));
                        heading.appendChild(anchor);
                    } else {
                        anchor.setChars(heading.getFirstChild().getChars().subSequence(0, 0));
                        heading.getFirstChild().insertBefore(anchor);
                    }
                } else {
                    anchor.takeChildren(heading);
                    heading.appendChild(anchor);
                }

                anchor.setCharsFromContent();
                state.nodeAdded(anchor);
            }
        }
    
<methods>public non-sealed void <init>() ,public final @NotNull Document processDocument(@NotNull Document) <variables>