Added head and body injection to editor template. #5347
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.

I've added head and body injection to the editor template, so that the preview for the page shows custom web components / page extensions that have been injected into the extra head / extra body portion of the settings.
Use Case
Since there isn't currently any kind of plugin or extension system, I decided to write some custom html components (i.e. images with captions/details sections, custom symbols for rpg dice results, etc) to wrap up what was turning into a bit of a nightmare of custom style + copy/pasting boilerplate html all over the place. Using web components turned out to be really easy, as I just have to add a
.cssand.jsfile into the head of my wiki, and then the custom components work great (especially the shadow dom style encapsulation). Except, none of the custom markup renders in the preview.The fix seemed simple enough, and adds a very nice vector for extending wiki.js, imho.
Questions