Skip to content

Commit 3e72bdf

Browse files
committed
Remove protect from config, instead use Readme
1 parent 73abeb0 commit 3e72bdf

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ and dynamic editing capabilities.
2727
## Extra
2828

2929
> [!IMPORTANT]
30-
> Want some steroids for your TinyMCE? [Check out](https://github.com/The-3Labs-Team/tinymce-chatgpt-plugin) our new **ChatGTP for TinyMCE** plugin! 🚀🚀🚀
30+
> Want some steroids for your TinyMCE? [Check out](https://github.com/The-3Labs-Team/tinymce-chatgpt-plugin) our new *
31+
*ChatGTP for TinyMCE** plugin! 🚀🚀🚀
3132

3233
## Demo & Screenshots
3334

@@ -198,6 +199,30 @@ file `config/nova-tinymce-editor.php`:
198199

199200
Please be sure that `image` plugin and toolbar button are enabled in your config file.
200201

202+
## Protect code
203+
204+
You can to control what contents [should be protected](https://www.tiny.cloud/docs/tinymce/6/content-filtering/#protect)
205+
from editing while it gets passed
206+
into the editor. This is useful for example when you want to protect PHP code from been formatted.
207+
208+
To do this, you must publish the configuration file and add the following line:
209+
210+
```php
211+
<?php
212+
213+
return [
214+
'init' => [
215+
// ... Your awesome init config ...
216+
/**
217+
* Set what content should be protected while editing
218+
* This should be a regular expression
219+
* E.g "/<\?php.*?\?>/g" - Protect PHP code from been formatted
220+
*/
221+
'protect' => []
222+
];
223+
//...
224+
```
225+
201226
## Upgrade from 1.0.x to 1.1.x
202227

203228
The transition to 1.1 involves the use of a new configuration layout compatible with the previous version.

config/nova-tinymce-editor.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@
2828
'browser_spellcheck' => true,
2929
'contextmenu' => false,
3030
// 'images_upload_url' => '/nova-vendor/murdercode/tinymce/upload', // Uncomment this line if you want to enable images upload
31-
32-
/**
33-
* Set what content should be protected while editing - This should be a regular expression E.g "/<\?php.*?\?>/g" - Protect PHP code from been formatted
34-
*/
35-
'protect' => []
3631
],
3732
'plugins' => [
3833
'advlist',

0 commit comments

Comments
 (0)