Note the update to the second match group (after the | in the [[  | ]] form.  That was the reason your new link_spec was failing.  It was not matching this RE with the link_text not 'masked'.  We may want to tighten up the parsing, but what it really needs is a more formal syntax definition and a real parser.