@@ -30,6 +30,22 @@ export const INLINE_CONTENT_STYLES = `
3030 }
3131` ;
3232
33+ /**
34+ * Shared TinyMCE options for EMA inline editing (excluding per-instance `setup`).
35+ * Exported so URL-handling defaults (e.g. convert_urls) stay covered by unit tests.
36+ */
37+ export const INLINE_EDIT_TINYMCE_BASE_OPTIONS = {
38+ menubar : false ,
39+ inline : true ,
40+ // Avoid rewriting root-relative URLs (e.g. /dA/...) to ../... on serialize; iframe base differs from site root.
41+ convert_urls : false ,
42+ valid_styles : {
43+ '*' : 'font-size,font-family,color,text-decoration,text-align'
44+ } ,
45+ powerpaste_word_import : 'clean' ,
46+ powerpaste_html_import : 'clean'
47+ } as const ;
48+
3349@Injectable ( {
3450 providedIn : 'root'
3551} )
@@ -39,17 +55,11 @@ export class InlineEditService {
3955 private $inlineEditingTargetDataset = signal < InlineEditingContentletDataset | null > ( null ) ;
4056
4157 private readonly DEFAULT_TINYMCE_CONFIG = {
42- menubar : false ,
43- inline : true ,
44- valid_styles : {
45- '*' : 'font-size,font-family,color,text-decoration,text-align'
46- } ,
47- powerpaste_word_import : 'clean' ,
48- powerpaste_html_import : 'clean' ,
58+ ...INLINE_EDIT_TINYMCE_BASE_OPTIONS ,
4959 setup : this . #handleInlineEditEvents
5060 } ;
5161
52- private readonly TINYCME_CONFIG = {
62+ private readonly TINYMCE_CONFIG = {
5363 minimal : {
5464 plugins : [ 'link' , 'autolink' ] ,
5565 toolbar : 'bold italic underline | link' ,
@@ -162,7 +172,7 @@ export class InlineEditService {
162172
163173 this . $iframeWindow ( )
164174 . tinymce . init ( {
165- ...this . TINYCME_CONFIG [ dataset . mode || 'minimal' ] ,
175+ ...this . TINYMCE_CONFIG [ dataset . mode || 'minimal' ] ,
166176 selector : dataSelector
167177 } )
168178 . then ( ( [ ed ] ) => {
0 commit comments