-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interaction between preprocessor/preparser and slide editor #1579
Comments
The preparser is for very specific uses cases and indeed breaks editor integration (we might want to highlight it more clearly in the documentation). Having a full round trip edition is way too much work (and technically not always possible) compared to the gain. I guess an improvement (still not so easy) would be to disallow the edition of slides in files that have been preparsed. |
I ran into this today. To me it seems, that the editor should show the slide content from before preprocessing. Or am I missing something? |
Fixes slidevjs#1579. Otherwise, the editor would load the preprocessed content and overwrite the unprocessed content.
Fixes slidevjs#1579. Otherwise, the editor would load the preprocessed content and overwrite the unprocessed content.
Fixes slidevjs#1579. Otherwise, the editor would load the preprocessed content and overwrite the unprocessed content.
Describe the bug
This one is a little tricky and I apologize if misunderstanding how things should work. The preparser extensions (documented here) imply that your .md file is read in and then processed prior to be rendered. However, when using slide edit mode, the preprocessed file is written back out to disk. For example, in the example 1 where you replace your compact syntax notation, the idea is to make your markdown shorter. However, if you were to run this, then open the code in the slide editor would immediately overwrite your compact .md file with the expanded versions of these macros.
To Reproduce
Steps to reproduce the behavior:
setup/preparser.ts
file with something that adds new lines to the .md during preprocessing.filename: XXX
in the front matter defined twice (also there start being errors from the front matter preprocessor because in this case the change introduced two variables with the same name).My expectation is that opening the slide editor while using the preparser shouldn't interact. Alternatively, this issue could be expected behavior in which case I'd mention that people should view the preprocessor as being applied multiple times to your file in the event you open the slide editor (so the code needs extra logic to handle that). Alternatively, the slidev should somehow write out to disk only the changes to the file from the slide editor but none of the changes rendered by the preparser.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: