It looks like it must be overwriting itself such that the only content in the created file is from the last section with the given heading. But all the content is replaced by a link. Obviously, you're not expecting headings at the same level to be duplicated.
It looks like it must be overwriting itself such that the only content in the created file is from the last section with the given heading. But all the content is replaced by a link. Obviously, you're not expecting headings at the same level to be duplicated.