Repository navigation
Write notebook text as itself instead of \u escapes - #120
Merged
Merged
Conversation
Use the relaxed JSON encoder in both notebook serializers so source text is written as plain UTF-8 instead of unnecessary \u escapes. This keeps Jupyter and Verso files diff-friendly, searchable, and still backward-compatible with older escaped files. Tests cover raw text serialization and deserialization of legacy escaped content. Signed-off-by: Torrey Betts <[email protected]>
2 tasks done
SummarySummary
CoverageVerso - 82.2%
Verso.Abstractions - 84.2%
Verso.Ado - 81.4%
Verso.Blazor - 30.7%
Verso.Blazor.Shared - 61.9%
Verso.Cli - 41.4%
Verso.DataFrame - 82.3%
Verso.FSharp - 81.8%
Verso.Host - 56%
Verso.Http - 74.7%
Verso.JavaScript - 52.7%
Verso.PowerShell - 64.7%
Verso.Python - 78.1%
Verso.Sample.Diagram - 80.1%
Verso.Sample.Dice - 82.2%
Verso.Sample.Slides - 58.8%
Verso.Sample.Sparkline - 67.3%
Verso.Testing - 79.7%
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The .verso and Jupyter writers used the default JSON encoder, which writes quotes, '+', '<', '>' and every non-ASCII character as \uXXXX escapes. A workspace search for
#r "nuget:found nothing, German or Japanese markdown could not be searched at all, and saving a notebook that came from Jupyter rewrote every line holding a quote. Both writers now use the relaxed encoder and keep that text as it is. Files written with the old escapes read the same, and each notebook shows one larger diff the first time it's saved after this change. Characters outside the Basic Multilingual Plane, such as emoji, are still escaped.Tests cover what both writers now produce and reading a file written with the old escapes. The two write tests fail on the previous code. Part of #118.