marc0l92 / joplin-plugin-plantUML

Render PlantUML diagram inside your Joplin notes.
MIT License
47 stars 8 forks source link

Diagrams order is incorrect in exported file #16

Open Teddy12090 opened 1 year ago

Teddy12090 commented 1 year ago

Environment:

source:

```plantuml
@startuml
Alice -> Bob: Authentication Request
Bob --> Alice: Authentication Response

Alice -> Bob: Another authentication Request
Alice <-- Bob: Another authentication Response
@enduml
@startuml
class Parent
class Child
Parent <|-- Child
@enduml


expected:
<img width="304" alt="image" src="https://github.com/marc0l92/joplin-plugin-plantUML/assets/3054877/c9c2619c-cd92-4154-bb3c-a65402276a5a">

actual: (via Export -> HTML - HTML File)
<img width="303" alt="image" src="https://github.com/marc0l92/joplin-plugin-plantUML/assets/3054877/ddb4eac6-fc11-4ccb-b148-4c97e6f2b7c5">

The order of the two diagrams is incorrect. The class diagram should be on the top of the sequence diagram.

I think it may be easier to check the result using rick text editor, it also shows the incorrect order.

<img width="501" alt="image" src="https://github.com/marc0l92/joplin-plugin-plantUML/assets/3054877/29e5c7e0-299f-47f3-81eb-9f8001378276">
Teddy12090 commented 1 year ago

v1.9 works, but v1.10 and 1.11 don't work

Teddy12090 commented 1 year ago

I found that the bug is caused by this commit (https://github.com/marc0l92/joplin-plugin-plantUML/commit/20f48682b0b054d0b2a4ff4e8fe80bd610bfb285) and it was introduced after v1.10.

I have tried removing previousDiagramId and checked the result, and it indeed resolves the bug. However, since I am not experienced in frontend development, I am unable to assess the potential side effects of removing previousDiagramId. Could anyone help with this issue? Thanks.

gletaille commented 11 months ago

Hi I have the same problem it would be great if it can be fixed thanks a lot

milanmarcinco commented 9 months ago

Just encoutered the same bug as well. Is there any workaround for this in the meantime?

dimau commented 5 months ago

Hi, guys! Have the same problem