• Resolved PJ3CX

    (@3cx)


    Hello,
    Using the create_event API our application create tasks with Notes.
    The problem is that these Notes can be long and our text gets all packed as line breaks are removed.
    Whereas a task created manually from the admin panel, going in a Contact/Add Task, allows to input a <br> tags to insert line breaks.

    Would it therefore be possible to preserve line breaks in the “notes” field when events are created from the API?

    As far as we could see this is due to the sanitize_text_field() function used in api/create_event.php.

    Thanks in advance,
    PJ

Viewing 1 replies (of 1 total)
  • Plugin Support Stef (a11n)

    (@erania-pinnera)

    Hi there, @3cx,

    Due to our scope of support, we can provide very limited assistance on questions related to API.
    You should be able to find more information on this page.

    If you have the ability to duplicate the API to modify it, or if you can create a custom endpoint, you might consider adjusting the sanitization process to allow for certain HTML tags like?<br>, or alternatively, modify the API to accept and process encoded line breaks (e.g.,?\n?gets converted to?<br>?on display). However, modifying the API could have security implications, so it must be done carefully.

    Please keep in mind that I haven’t tested this above mentioned solution.

    Hope that helps!

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.