xwikisas / application-diagram

Create various types of diagrams using draw.io
GNU Lesser General Public License v2.1
0 stars 8 forks source link

Updating links after renaming a page only works for the first link when the text is separated by "Enter" #151

Closed oanalavinia closed 4 years ago

oanalavinia commented 4 years ago

Steps to reproduce:

  1. Create a new Diagram
  2. Add a Text shape
  3. Add some text on different rows separated by enter
  4. Add links to two of the rows (the full row must be selected) example
  5. Click Save & View
  6. Go the second linked page and rename it
  7. Go back to the diagram and check the link

Expected results: The second link was renamed properly

Actual results: The link remained the same

For the first link the rename works correctly

Tested with Diagram Application 1.13.2, XWIki 11.10.4

oanalavinia commented 4 years ago

Investigation: this issue is related to the fix added by #118 and as said in https://github.com/xwikisas/application-diagram/pull/146#discussion_r425681485 the problem is that we are only checking for the first link here https://github.com/xwikisas/application-diagram/blob/master/application-diagram-api/src/main/java/com/xwiki/diagram/internal/handlers/DiagramLinkHandler.java#L217