-
Notifications
You must be signed in to change notification settings - Fork 65
REST-API delivers wrongly formatted HTML of Textarea-fields with formatting #299
Description
When developing a solution using the Akeneo REST-API, I noticed an issue with the HTML-content of textarea-fields with formatting.
This seems to occur, when bold and underline formatting-settings are applied on the same content and only bold formatting being applied directly after that. For example: "Bold and underlined only bold"
UI:
<u><b>Note</b></u><b>:</b>
is turned into
API:
<u><b>Note</u>:</b>
In the field in Akeneo, the formatted content looks correct; also the HTML-structure in the "code-view" looks correct. In the following example the text „Note“ is encapsulated by bold- and underline-Tags; the colonafter that text „:“ is only encapsulated by a bold-Tag:
When retrieving the content of the field using the rest-API, the HTML-structure looks different; the inner bold-tags seem to be removed which causes the sequence of closing html-tags not match the sequence of opening tags. Below is a screenshot of exactly what Akeneo sends back:
This looks like a process within Akeneo changes the content that is visible in UI for the API result.
While this is turned into valid HTML by some HTML-parsers (for example webbrowser), not all parsers count it as valid HTML.
Especially the validator of w3.org doesn't recognize this as a valid structure (neither for HTML 4.0 nor for XHTML 1.0).
In processes subsequent the API-request, additional sanitizing of the retrieved HTML-content may be necessary.
Alternatively, Akeneo-users may need to adjust the HTML-tags manually for each occurrance of such a combination of HTML-tags.
These are not desired workarounds and it would be best, if valid HTML was returned.
This occurred on a system running Version: Serenity v20260219093823 Buttercup