Repository navigation
fix(build): a whole source pasted into the box replaces the one there - #159
Merged
Merged
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Change: Bug fix · Severity of issue fixed: Medium Merge Risk:
|
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.
Closes #158.
What changes
json-scan.ts:wholeSource(text), whether the text is a source as a chat hands one over, in a code fence or not: a JSON object whosetypeis an H5P content type's (H5P.…) and that has atitle.editor.ts) and the plain field it falls back to (build-page.ts): a paste of a whole source replaces everything in the box, wherever the caret is, as a paste over the untouched sample already did. A fragment, or text that is not JSON, goes in where it is pasted, as before. In the editor, undo brings the old text back.Tested
pnpm install --frozen-lockfileandpnpm build(tscincluded) pass.vite preview, pasting by the keyboard from the browser's own clipboard, in Chromium, Firefox and WebKit, and in Chromium with the editor's chunk refused (the plain field):"extra": 1,pasted inside a source goes in where it was pasted.wholeSourceon ten texts: a source, one in a code fence, no title, atypeof no H5P library,{"source": {…}}, a fragment, a question of a set (library), an array, broken JSON, blank. Only the first two count as whole.Summary by CodeRabbit