added option to control the default TinyMCE urls convert behavior

This commit is contained in:
Gani Georgiev
2023-08-22 14:28:25 +03:00
parent 9c0d952543
commit 2863763a27
39 changed files with 248 additions and 206 deletions
+6
View File
@@ -523,6 +523,12 @@ func (o UrlOptions) Validate() error {
// -------------------------------------------------------------------
type EditorOptions struct {
// ConvertUrls is usually used to instruct the editor whether to
// apply url conversion (eg. stripping the domain name in case the
// urls are using the same domain as the one where the editor is loaded).
//
// (see also https://www.tiny.cloud/docs/tinymce/6/url-handling/#convert_urls)
ConvertUrls bool `form:"convertUrls" json:"convertUrls"`
}
func (o EditorOptions) Validate() error {
+1 -1
View File
@@ -505,7 +505,7 @@ func TestSchemaFieldInitOptions(t *testing.T) {
{
schema.SchemaField{Type: schema.FieldTypeEditor},
false,
`{"system":false,"id":"","name":"","type":"editor","required":false,"presentable":false,"unique":false,"options":{}}`,
`{"system":false,"id":"","name":"","type":"editor","required":false,"presentable":false,"unique":false,"options":{"convertUrls":false}}`,
},
{
schema.SchemaField{Type: schema.FieldTypeDate},