Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line breaks problem in text editors #54

Closed
Eronana opened this issue May 20, 2024 · 7 comments
Closed

Line breaks problem in text editors #54

Eronana opened this issue May 20, 2024 · 7 comments
Labels

Comments

@Eronana
Copy link

Eronana commented May 20, 2024

Due to the use of form, all line breaks become CRLF, which is disastrous.
Perhaps another way to POST text data should be considered.

By the way, is it possible to use other more modern text editors?
I realize that WFM is a simple application, and the current editor is rudimentary, but it seems adequate.
So I'm not sure if introducing a modern editor with syntax highlighting is a good idea.
image

@tenox7
Copy link
Owner

tenox7 commented May 22, 2024

hmmm yeah, I was thinking about it before, those are separate issues really

for cr/lf what I could do is add a dropdown in the editor to force save with different formats
there already is a feature request for this
#8

for better editor, yes, if a modern browser is used, wfm already detects modern browsers so I could spew out different editor for these - do you have any suggestions?
for a better editor also this
#19

@tenox7
Copy link
Owner

tenox7 commented May 22, 2024

I added crlf <> lf conversion in head master, it would be cool if you could test it more

@Eronana
Copy link
Author

Eronana commented May 23, 2024

It works fine with LF, but there is a little bit bug with CRLF:

wfm/fileio.go

Lines 155 to 156 in 6b193a1

case "CRLF":
uData = strings.ReplaceAll(uData, "\n", "\r\n")

The form itself converts LF to CRLF, so if you convert it again it becomes CRCRLF.
image

@tenox7
Copy link
Owner

tenox7 commented May 23, 2024

wow good find

@tenox7
Copy link
Owner

tenox7 commented May 23, 2024

ok just removed this case
should work fine now, could you test?
thanks!

@tenox7 tenox7 added the bug label May 23, 2024
@tenox7
Copy link
Owner

tenox7 commented May 28, 2024

hey any chance you could confirm that there are no further issues with this? thanks!

@Eronana
Copy link
Author

Eronana commented May 29, 2024

I just tested, it works great now, thank you!

@Eronana Eronana closed this as completed May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants