Fix markdown cell do not re-render when re-executed #155268
Open
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.
This PR fixes #151151
With this PR I added a new command (
notebook.cell.finishEdit
) that increments the cell's text model version ID when triggered, I changed the re-rendering logic from content-based to version ID-based as well. This is done to distinguish between the action of re-executing cell and stop editing cell.Meanwhile the already-existing command (
notebook.cell.quitEdit
) now only exits the cell edit mode when triggered, it does not trigger a re-render.Tbh I don't fully understand some parts of the changes, so let me know if I can do some things better.
How to test
<img src="myimg.png">
.