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

[flat-json-widget] Preserve newline characters in input fields. Issue where newline characters (\n) in input fields were removed when saving via the HTML form. Updated the logic to ensure newline characters are preserved in both display and saved data. Fixed #19 #32

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

mrgear111
Copy link

@mrgear111 mrgear111 commented Jan 26, 2025

[flat-json-widget] Preserve newline characters in input fields (#19)

Description:

This PR fixes an issue where newline characters (\n) in input fields were being removed upon saving data through the HTML form. The logic has been updated to ensure that newline characters are preserved correctly in both the display and the saved data.

Fixes #19

Checklist:

  • I have followed the OpenWISP contribution guidelines.
  • I have manually tested the changes proposed in this pull request.

Testing:

  • Verified that newline characters are retained in the input fields when editing and saving data via the HTML form.

This is my first time creating a PR, and I was trying to follow your contribution guidelines. I mistakenly committed four times, but the main fix is in the first commit. Please review it.

…sp#19

Fixed an issue where newline characters () in input fields were removed when saving via the HTML form. Updated the logic to ensure newline characters are preserved in both display and saved data.

Fixed openwisp#19
…sp#19

Fixed an issue where newline characters () in input fields were removed when saving via the HTML form. Updated the logic to ensure newline characters are preserved in both display and saved data.

Fixes openwisp#19
@mrgear111 mrgear111 changed the title [flat-json-widget] Preserve newline characters in input fields #19 Fixed an issue where newline characters (\n) in input fields were removed when saving via the HTML form. Updated the logic to ensure newline characters are preserved in both display and saved data. Fixed #19 [flat-json-widget] Preserve newline characters in input fields. Issue where newline characters (\n) in input fields were removed when saving via the HTML form. Updated the logic to ensure newline characters are preserved in both display and saved data. Fixed #19 Jan 26, 2025
Copy link

@KanishkRanjan KanishkRanjan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The input tag in HTML removes special characters like \n, which was the root cause of this bug. This behavior has now been handled correctly.

@KanishkRanjan
Copy link

@nemesifier can we please merge this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

[bug] Input fields does not respect newlines
3 participants