Command Tag parsing is greedy for tag body. It includes content AFTER the end of the tag, to the last ">" in the email content
For this email content:
The labels are parsed as:
because the pattern matching in the parsing is GREEDILY matching the body of the M2P tag until the LAST ">" in the content. It is matching as much as possible in the tag body instead of as little as possible.
It should be LAZILY matching the body of the M2P tag until the FIRST ">" to that it becomes:
The bug results in an attempt to save a label like "foo2>asdfasdf\r\n<br/>..." on a page and that fails with an IllegalArgumentException in Confluence's DefaultLabelManager