Skip to content

REST-API delivers wrongly formatted HTML of Textarea-fields with formatting #299

@OhLookAUser

Description

@OhLookAUser

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:

Image

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:

Image

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions