thompsonsj / slate-serializers

Serialize Slate JSON objects to HTML and vice versa. Define rules to modify the end result.
85 stars 12 forks source link

Adding an option to preserve spacing during HTML to Slate deserialization #115

Closed judsonjuniorr closed 1 year ago

judsonjuniorr commented 1 year ago

Description Currently, when deserializing HTML to Slate, the deserialization function removes excess whitespaces, causing issues in a specific chord editor application where it is crucial to maintain specific spacings between chords within the sheet music.

Context The application in question is a chord editor that requires preserving multiple spaces between chords to ensure correct spacing.

Proposal A Pull Request has been submitted proposing a modification to the deserialization function's settings, adding an option that allows the preservation of spacings as necessary for the specific chord editor application.

Link to Pull Request https://github.com/thompsonsj/slate-serializers/pull/114

thompsonsj commented 1 year ago

Thanks!

Test added in https://github.com/thompsonsj/slate-serializers/pull/116. Not all whitespace is preserved so let me know if you think that should be changed.

Released in https://www.npmjs.com/package/@slate-serializers/html version 2.1.0.