improve link inclusion processing, prevent endless recursion