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

Ensure Proper Handling of Special Characters in Socket Communication #5

Open
mathe00 opened this issue Sep 30, 2024 · 0 comments
Open
Labels
help wanted Extra attention is needed

Comments

@mathe00
Copy link
Owner

mathe00 commented Sep 30, 2024

Description

Currently, the communication between Python scripts and Obsidian relies on JSON formatting over sockets. However, special characters such as quotes (" or '), commas (,), braces ({}), and other similar symbols present in note content, titles, or any data being passed through the socket can potentially disrupt the JSON structure and lead to errors in the communication process.

Expected Behavior

To ensure smooth communication over sockets, the system should properly escape and encode any special characters found in the content, title, or other data fields passed through the socket. This should include, but is not limited to:

  • Double and single quotes
  • Commas
  • Curly braces {}, square brackets []
  • Colons, semicolons
  • Backslashes \
  • Other potentially problematic characters

This way, the JSON strings remain valid and intact when being transmitted, and the system can handle any input safely without causing socket or parsing issues.

Additional Considerations

  • Handle cases where large chunks of data are passed that include special characters in various fields.
  • Ensure that JSON encoding/decoding processes escape characters in compliance with JSON standards.
  • Perform thorough testing for notes with edge cases, such as those containing code blocks or special symbols, to prevent communication failure.

By ensuring this, we can avoid communication errors between Obsidian and Python scripts, ensuring data integrity and smooth functionality.

@mathe00 mathe00 added the help wanted Extra attention is needed label Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant