Ideally you shouldn’t do what you do since it’s bypassing the history feature of XWiki which is there to track all changes, whatever they are, for accountability and more.
Mentions are sent only when a new mention macro is added. Thus if you make a change to a page which contains an existing mention, the mention notification won’t be sent.
The only debate to be had is whether notifications should be visible when you add a mention to a page and save the page as a minor edit. It could be consistent with our notifications to not show them by default (with an option to receive them for minor edits too,). However, it would also remove some use case, like the ability to mention someone to check a refactoring on the page.
XWiki seams to do some correction in the mention in some cases.
I can not reproduce this behavior, but today i receive a notification for a page with a existing mention and the history looks like this:
Yes, when using the WYSIWYG editor, the content is parsed, transformed as HTML, then you make modifications to the HTML in the WYSIWYG editor and when saving, the content is parsed as HTML, and converted again in the original document syntax.
Thus, if the original content was using some syntax “shortcuts” and not the canonical form, it’s transformed into the canonical form.
As I said, you’ll only get a notification the first time a mention macro is used (or maybe when it’s parameters are changed, to be checked). So when editing existing docs you won’t receive new mentions if you don’t change the mention macros.
The mention notifications are based on a comparison with the previous revision. If you use this hack to avoid creating a revision, I believe this breaks the mention macro analysis and thus leads to duplicate notifications if the mention macro was added in the current revision. I don’t know if this is something we would consider as a bug as it is clearly a hack. I would discourage to use this hack to avoid saving revisions on pages that can contain arbitrary content.
I think to reproduce you need to save a page three times:
Create the document
Add the mention macros (creating a new revision)
Save without creating a new revision
I believe that then in step 3, the same notifications as in step 2 will be sent. But I haven’t verified it and I haven’t checked if the code that I’ve linked is actually executed in the case of saving without creating a new revision.