sulu / SuluHeadlessBundle

Bundle that provides controllers and services for using Sulu as headless content management system
MIT License
47 stars 25 forks source link

HTML post processing for text-editor #16

Closed wachterjohannes closed 3 years ago

wachterjohannes commented 4 years ago

The text editor in sulu can contain various special HTML tags which will be resolved in the traditional system via the response listener sulu_markup.response_listener which calls the right parser for the current request format - but in the core there is only a HTML markup parser implemented.

We could provide an additional markup parser for JSON which crawls the JSON object and resolves all HTML fields.

See following files in sulu:

alexander-schranz commented 4 years ago

Maybe with some response header the JSON Parser could be activated or disabled, because for example in admin api's you don't want that its replaced and we should avoid context based configuration and services.

alexander-schranz commented 4 years ago

@wachterjohannes what if we resolve at current state in a TextEditorResolver?

niklasnatter commented 4 years ago

If these tags are used only in the text_editor content type, I think providing a TextEditorResolver implements ContentTypeResolverInterface is a good solution at the moment

alexander-schranz commented 4 years ago

@nnatter for headless bundle the texteditor resolver would be enough.