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

fix watch mode parsing of self-closing div in svg #1119

Merged
merged 2 commits into from
Mar 31, 2023

Conversation

gavin-ts
Copy link
Contributor

@gavin-ts gavin-ts commented Mar 31, 2023

Summary

Fixes a bug where the svg structure could become corrupted in watch mode due to a self-closing div.

Details

  • fixes lost connector #1084
  • when setting innerHTML in watchmode, it would parse a self-closing div incorrectly
  • Issue seems to be from self closing div tags being invalid in html. https://stackoverflow.com/a/206409
  • Note: in windows, a md label block is considered not an empty label, containing a \r char. However this can also happen without CRLF endings a md block with 2 newlines :

example with 2 newlines:

you: {shape: person}
you -> form
form: {
  get: |md


  |
}

before the svg is parsed incorrectly when setting innerHTML

self closing div ends up parsed as an open div tag

Screen Shot 2023-03-31 at 1 31 49 PM

after svg is valid xhtml and parsed correctly

Screen Shot 2023-03-31 at 1 32 25 PM

@gavin-ts gavin-ts changed the title add windows_crlf test fix self-closing tag in xhtml Mar 31, 2023
@gavin-ts gavin-ts changed the title fix self-closing tag in xhtml fix self-closing tag in svg Mar 31, 2023
@gavin-ts gavin-ts changed the title fix self-closing tag in svg fix self-closing div in svg Mar 31, 2023
@gavin-ts gavin-ts changed the title fix self-closing div in svg fix self-closing div in svg in html Mar 31, 2023
@gavin-ts gavin-ts changed the title fix self-closing div in svg in html fix watch mode parsing of self-closing div in svg Mar 31, 2023
@gavin-ts gavin-ts requested a review from a team March 31, 2023 21:19
@gavin-ts gavin-ts marked this pull request as ready for review March 31, 2023 21:19
@gavin-ts gavin-ts enabled auto-merge March 31, 2023 21:19
Copy link
Contributor

@nhooyr nhooyr left a comment

Choose a reason for hiding this comment

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

Makes sense

@gavin-ts gavin-ts merged commit 1b65be6 into terrastruct:master Mar 31, 2023
@gavin-ts gavin-ts mentioned this pull request Mar 31, 2023
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.

lost connector
2 participants