# markdown_preview: Fix Ctrl\+S saving checkbox toggle state \(\#53236\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/df92d593cdc5185c4ac1f91097773ebcb81f1d51)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: df92d593cdc5185c4ac1f91097773ebcb81f1d51

Requested commit: df92d593cdc5185c4ac1f91097773ebcb81f1d51

Commit: df92d593cdc5185c4ac1f91097773ebcb81f1d51

Tree: 89aedc9acd277566b136f72fcacefb9a753ad4fa

Author: Pronsh

Committer: GitHub

## Message

```
markdown_preview: Fix Ctrl+S saving checkbox toggle state (#53236)

Changes Made:

- Adding the `Item::can_save()`, `save()`, `save_as()`, `can_save_as()`
functions to help the Editor save when a checkbox is toggled
- Small refactor to seperate checkbox toggle and refreshing preview
- Adding support for both `/...` and `\\...` for windows users. [NOTE: I
no longer own a window's machine and I am unsure if this is correct, and
will fix it immediately if this is wrong]
- Resolving preview paths, strips out the fragment, and image paths are
coalesced to None if they don't exist
- Adding Tests for the added behaviour [NOTE: would love feedback since
this is the first time I am writing tests, and had a bit of assistance
from an AI, but manually reviewed the code and ran the application and
it seemed fine]

Self-Review Checklist:

- [X] I've reviewed my own diff for quality, security, and reliability
- [X] Unsafe blocks (if any) have justifying comments
- [X] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [X] Tests cover the new/changed behavior
- [X] Performance impact has been considered and is acceptable

Closes #46901

Release Notes:

- Fixed Crtl+S saving while toggling checkbox in preview mode
```

## Parents

- [5aa7eaa508e043a5f68ffec16af09b2ce6da8404](https://git.cafe/gitcafe/zed/commit/5aa7eaa508e043a5f68ffec16af09b2ce6da8404?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/df92d593cdc5185c4ac1f91097773ebcb81f1d51?format=markdown)
