hpi-swa-teaching / RichTextEditing

MIT License
5 stars 0 forks source link

All hyperlinks have the same url associated #122

Open konradh opened 4 years ago

konradh commented 4 years ago

All hyperlinks open the same URL on click. Probably a problem with object equality or how TextStructures get applied to text. The links are the same in RichTextEditor and structure editor although only the ones associated with the same RichTextDocument.

frcroth commented 4 years ago

@konradh Is this still the case after the refactoring?

konradh commented 4 years ago

@konradh Is this still the case after the refactoring?

It is only the case after the refactoring.

frcroth commented 4 years ago

Can not reproduce that the pages are the same. However I encountered some behaviour that is probably not intentional. When typing a url and then applying the url structure, a link is created that has correct behavior. This also happens when another, different url is written, the HTTP request is then send to the correct new address on click. However when a url is pasted, the url turns into a link but not into a url structure. The request is therefore invalid, as the HTTP request handles a Text instead of a string.

frcroth commented 4 years ago

Ok the link not working was an easy fix, but another problem is that pasted links are not of the url text structure. This is an architectural problem, as the RichTextEditor, which handles the pasting of the url can not access the existing text structures of the document.

konradh commented 4 years ago

Can not reproduce that the pages are the same.

@oleschl @sirkrypt0 @j-hellenberg Can you reproduce this bug?

How to reproduce:

  1. Open a new editor.
  2. In the editor, write "Hello World".
  3. Select the word "Hello" and apply the url structure.
  4. Click the resulting link. It should point to "Hello".
  5. Select the word "World" and apply the url structure.
  6. Click the resulting link. It should point to "World".
  7. Click the "Hello" link. It too should now point to "World".
frcroth commented 4 years ago

Can not reproduce that the pages are the same.

@oleschl @sirkrypt0 @j-hellenberg Can you reproduce this bug?

How to reproduce:

1. Open a new editor.

2. In the editor, write "Hello World".

3. Select the word "Hello" and apply the `url` structure.

4. Click the resulting link. It should point to "Hello".

5. Select the word "World" and apply the `url` structure.

6. Click the resulting link. It should point to "World".

7. **Click the "Hello" link. It too should now point to "World".**

I can reproduce this with the extended explanation

oleschl commented 4 years ago

Can not reproduce that the pages are the same.

@oleschl @sirkrypt0 @j-hellenberg Can you reproduce this bug? How to reproduce:

1. Open a new editor.

2. In the editor, write "Hello World".

3. Select the word "Hello" and apply the `url` structure.

4. Click the resulting link. It should point to "Hello".

5. Select the word "World" and apply the `url` structure.

6. Click the resulting link. It should point to "World".

7. **Click the "Hello" link. It too should now point to "World".**

I can reproduce this with the extended explanation

Same here

konradh commented 4 years ago

Okay, I will try to fix this and the pasted link is not a TextStructure thing.

frcroth commented 4 years ago

Okay, I will try to fix this and the pasted link is not a TextStructure thing.

What do you mean "is not a TextStructure thing"? I think the current behaviour is very confusing and should be changed to apply a url structure (which is not possible with the current architecture) or remove the behaviour of creating a link

sirkrypt0 commented 4 years ago

If the current architecture really does not allow for pasting urls, it would be fine by me to leave that out and have the user apply the url structure manually.

sirkrypt0 commented 4 years ago

Tradeoff: either

The reason is that when structures are changed using the Manage Structures window all structures in the text that are equal (using the = operator) are updated, but also structures that are equal have the same url