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

parseICS producing invalid HTML in description fields #161

Open
ehynds opened this issue Nov 4, 2021 · 0 comments
Open

parseICS producing invalid HTML in description fields #161

ehynds opened this issue Nov 4, 2021 · 0 comments

Comments

@ehynds
Copy link

ehynds commented Nov 4, 2021

Hi, thanks for the great library.

I noticed parseICS is mangling HTML inside description fields. Given this VEVENT description with escaped quotes:

BEGIN:VEVENT
...
DESCRIPTION:<p><a href=\"http://google.com\" rel=\"noopener noreferrer\" t
 arget=\"_blank\">google.com</a></p>
X-ALT-DESC;FMTTYPE=text/html:<p><a href=\"http://google.com\" rel=\"noopen
 er noreferrer\" target=\"_blank\">google.com</a></p>
...
END:VEVENT

The output after parsing is:

{
  ...
  description: '<p><a href=\\http://google.com\\ rel=\n' +
    'oopener noreferrer\\ target=\\_blank\\>google.com</a></p>',
  'ALT-DESC': {
    params: [Object],
    val: '<p><a href=\\http://google.com\\ rel=\n' +
      'oopener noreferrer\\ target=\\_blank\\>google.com</a></p>'
  },
  ...
}

I tried unescaping the quotes but that removes them altogether, which is fine for HTML, but not for quotes in the description that aren't parent of HTML tags.

Is there any guidance on how to deal with HTML descriptions? Thanks!

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

No branches or pull requests

1 participant