Fruchtzwerg94 / PlantUmlViewer

A Notepad++ plugin to generate, view and export PlantUML diagrams
MIT License
78 stars 8 forks source link

[BUG] Random text overlapping. #29

Open that-guy-rob opened 1 month ago

that-guy-rob commented 1 month ago

Description When rendering PlantUML diagrams in Notepad++, the text at seemingly random places in some lines in a multiline definition (example legends or activity diagram definition) wraps incorrectly and overlaps at the beginning of the line. Adding a certain characters like a period or comma seams to fix it but I've noticed that ! or ? doesn't help. I inserted a special hidden character ​ which resolves the issue, but this is not an ideal solution.

Reproduction Steps to reproduce the behavior:

  1. Installed the PlantUML plugin in Notepad++.
  2. Created a PlantUML diagram with a legend.
  3. Observed the text wrapping and overlapping behavior.

Expected behavior The text in the legend should render correctly without overlap or the need for special characters.

Here is some of the code that caused the error: `### /signup_submit

@startuml
skinparam legendBackgroundColor lightgreen
skinparam defaultFontColor blue
skinparam legendAlignment left
skinparam defaultFontName "Arial Black"
skinparam legendFontSize 12

skinparam activity {
    BackgroundColor lightblue
    BorderColor black
    FontColor darkblue
    FontSize 16
}

legend top
————————————————————————————————
=<b>/signup_submit</b>
————————————————————————————————
  Handles user signup by receiving form data,
  validating email, creating new user,
  and redirecting to homepage.
end legend
start
    :Receive form data;
    :Extract email, username, and password;
    :Validate email format;
    if (Valid email format?) then (yes)
        :Validate username and password;
        if (Valid username and password?) then (yes)
            :Create new user;
            if (Success) then (yes)
                :Set session user;
                :Redirect to homepage;
            else (no)
                :Flash error message;
            endif
        else (no)
            :Flash error message;
        endif
    else (no)
        :Flash error message;
    endif
stop
@enduml

This is what happens: screenshot_of_error

This is the fix:


### /signup_submit
```plantuml
@startuml
skinparam legendBackgroundColor lightgreen
skinparam defaultFontColor blue
skinparam legendAlignment left
skinparam defaultFontName "Arial Black"
skinparam legendFontSize 12

skinparam activity {
    BackgroundColor lightblue
    BorderColor black
    FontColor darkblue
    FontSize 16
}

legend top
————————————————————————————————
=<b>/signup_submit</b>
————————————————————————————————
  Handles user signup by receiving form data,&#8203;
  validating email, creating new user,
  and redirecting to homepage.
end legend
start
    :Receive form data;
    :Extract email, username, and password&#8203;;
    :Validate email format;
    if (Valid email format?) then (yes)
        :Validate username and password;
        if (Valid username and password?) then (yes)
            :Create new user;
            if (Success) then (yes)
                :Set session user;
                :Redirect to homepage;
            else (no)
                :Flash error message;
            endif
        else (no)
            :Flash error message;
        endif
    else (no)
        :Flash error message;
    endif
stop
@enduml

This is the result: screenshot_of_error2

Environment

Additional information Add any other information about the problem here.

Fruchtzwerg94 commented 1 month ago

Hi @that-guy-rob ,

thanks for your report. Please note that PlantUMLViewer uses the PlantUML library to render the diagrams. In your case, this is a bug of the library itself which was fixed just recently in the latest version 1.2024.6. Since the current plugin ships with an older version of the library, it still persists here. Future releases of the plugin will contain a newer version then. So this issue will be fixed with the next release of PlantUMLViewer.

BR, Philipp

that-guy-rob commented 1 month ago

Awesome! I just wanted to help if I could. Thanks for making it. It's very useful!


From: Philipp Schmidt @.> Sent: July 26, 2024 6:41 PM To: Fruchtzwerg94/PlantUmlViewer @.> Cc: that-guy-rob @.>; Mention @.> Subject: Re: [Fruchtzwerg94/PlantUmlViewer] [BUG] Random text overlapping. (Issue #29)

Hi @that-guy-robhttps://github.com/that-guy-rob ,

thanks for your report. Please note, the PlantUMLViewer uses the underlying PlantUML library to render the diagrams. In your case, this is a bug of the library which was fixed just recently in the latest version 1.2024.6. Since the currents plugin ships with an older version of the library, it still persists here. Future releases of the plugin will contain a newer version then. So this issue will be fixed with the next release of PlantUMLViewer.

BR, Philipp

— Reply to this email directly, view it on GitHubhttps://github.com/Fruchtzwerg94/PlantUmlViewer/issues/29#issuecomment-2253283891, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AA7S5FB452VI6RPPOVYX4Z3ZOKJ5JAVCNFSM6AAAAABLPUHKESVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJTGI4DGOBZGE. You are receiving this because you were mentioned.