mapAutoLinkToType

fun List<ASTNode>.mapAutoLinkToType(targetType: IElementType = MarkdownTokenTypes.TEXT): List<ASTNode>

Extension function to map auto-link nodes to a specified target type.

This function iterates over a list of ASTNode objects and replaces any auto-link nodes (either GFM_AUTOLINK or AUTOLINK) with a new LeafASTNode of the specified target type. Other nodes remain unchanged.

Return

A new list of ASTNode objects with auto-link nodes mapped to the target type.

Parameters

targetType

The target type to map auto-link nodes to. Defaults to MarkdownTokenTypes.TEXT.