-
Notifications
You must be signed in to change notification settings - Fork 7
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
Missing code and/or documentation when using custom layout #49
Comments
Thank you Austin for the report. Did you check what version made that change? PS: I am happy to see you are still using |
Yeah, well it's gotten me this far :) I hope you dont feel any pressure for my sake to work on this. I just worked through it and thought it'd be good to document it. I'm sorry, but I'm not sure what version broke. It was a long time since I had upgraded. |
Something in a recent version changed and broke how the custom layouts work. I've found the problem and wanted to document the solution here:
First, one of the critical steps for prismjs to work is to have a
.language-
class present on the page. In the default layout, there is.language.vue
. When providing a custom layout, I think theeditor
slot should have that, but it does not. So the solution I found is to wrap theeditor
slot with a div with the classlanguage-vue
. This allows prismjs styles to be applied.Secondly, it looks like the inclusion of critical assets has been changed. The prism theme and prism editor CSS are no longer included by default when you provide a custom layout. I looked at the default layout Vue file to find my solution which was to include those assets in my custom layout
If I get the chance, I'll see about opening a PR for this. In the meantime, I wanted to document these issues here in case others run into them and need a solution.
For the fix, does it make more sense to fix the issue in the code, or was this a deliberate design? If so, then I can just add more documentation around it.
The text was updated successfully, but these errors were encountered: