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

Escape quotes in video description #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andrevvm
Copy link

Videos with double quotes in the description were failing to output the JSON correctly.

Copy link
Owner

@ttillberg ttillberg left a comment

Choose a reason for hiding this comment

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

Looks good, but could you please describe the background of the problem, and how/why you are solving it?

return;
}

var escaped = str.split(String.fromCharCode(92)).join(String.fromCharCode(92,92));
Copy link
Owner

@ttillberg ttillberg Jun 29, 2020

Choose a reason for hiding this comment

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

The problem I can see with this is that by escaping "" you could end up with "\\\" if you load, then save the value over again? Have you tested this?

Copy link
Owner

Choose a reason for hiding this comment

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

Curious about benefits of fromCharCode(92) over a replace(/\\/g,). Escaping is hell (alongside date conversions). Is this the holy grail? ✨ :

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

Successfully merging this pull request may close these issues.

2 participants