Faulty repeated insertion of 'class="wikiattachmentlink"'

If you create an “incorrect link” (it looks correct and it works !) to an attachment like:

      [[__title__>>attach:dok.pdf]]
      [[//title//>>attach:dok.pdf]]

or something like

[[(% style="...." %)title>>attach:dok.pdf]]##

instead of

__ [[title>>attach:dok.pdf]]__
//[[title>>attach:dok.pdf]]//

The WYSIWYG editor will insert a term of (% class=“wikiattachmentlink”) every time you change your document and after several rounds it looks like

[[(% class="wikiattachmentlink wikiattachmentlink wikiattachmentlink wikiattachmentlink wikiattachmentlink wikiattachmentlink wikiattachmentlink wikiattachmentlink wikiattachmentlink wikiattachmentlink wikiattachmentlink wikiattachmentlink wikiattachmentlink wikiattachmentlink wikiattachmentlink wikiattachmentlink wikiattachmentlink wikiattachmentlink wikiattachmentlink wikiattachmentlink wikiattachmentlink wikiattachmentlink wikiattachmentlink wikiattachmentlink wikiattachmentlink wikiattachmentlink wikiattachmentlink" %)__title__>>attach:dok.pdf]]

My XWiki version is: 11.10.10

The problem is easy to avoid. However, the uninitiated author is still quite irritated.

:wink: I have recommended the use of an editor that can do regular expressions.
Substitute

\[\[\(%.*?%\)(__|\/\/)*(.*?)(__|\/\/)*>>(.*?)\]\]

by

$1[[$2>>$4]]$3

Thanks
Norbert

Hi, this looks like a bug to me, could open a jira for it at XWiki Platform - XWiki.org JIRA ?

Thanks