BookStackApp / BookStack

A platform to create documentation/wiki content built with PHP & Laravel
https://www.bookstackapp.com/
MIT License
15.46k stars 1.94k forks source link

Add WYSIWYG editor button as part of Logical Theme Hack #5207

Closed LachTrip closed 2 months ago

LachTrip commented 2 months ago

Attempted Debugging

Searched GitHub Issues

Describe the Scenario

I understand there is a method for adding WYSIWYG editor buttons through custom HTML head, however I was hoping to find a way to do so as part of a logical theme so as to avoid using in app settings.

Exact BookStack Version

v24.03-dev

Log Content

No response

Hosting Environment

Debian 12, installed using official docker-compose

ssddanbrown commented 2 months ago

Hi @LachTrip, You could do this via the visual theme system to just add a custom script with the required code, in a location that's loaded when the editor is.

You'd just need to ensure any script tags have a nonce attribute applied as reflected below since otherwise they'd be blocked:

<script nonce="{{ $cspNonce }}">
    // JS code here
</script>
LachTrip commented 2 months ago

Thanks @ssddanbrown, Missed a step and was using a blade template completely unrelated.