Handling HTML tags in item names causing JSON parsing issues

Hi everyone,

While working on my task, I encountered an issue when using valid but unclosed HTML tags, such as <div>, in item names (items stored in a text column). Here’s what happens:

  1. When I save an item with a name like <div>, Monday accepts it as-is, and the data gets stored.
  2. However, upon refreshing the item-view that includes my application, the data returned by Monday (through monday.api from monday-sdk-js) seems to auto-correct itself by appending a closing tag, therefore appending </div> at the end of the string:

This modification makes the data no longer valid JSON, causing significant issues in my application.

Has anyone faced a similar issue or found a way to handle this? I’d also like to request that Monday consider addressing this behavior, as it is a big problem when dealing with user-generated content that includes HTML-like syntax.

Any help is greatly appreciated! Thank you!

Hello there @michael.le,

This is part of the sanitization process monday has.

You can create a feature request for our R&D team to modify the current behavior here :smile:

Cheers,
Matias

1 Like

Hi @Matias.Monday,

Is there a way to recategorize this post to a “feature request” instead of “monday Apps & Developers” ? I want to know because I don’t want to write basically the same post again, which I believe is against the norms here on monday community. Please confirm before I make another similar post.

Thank you

@Matias.Monday this isn’t really a feature request, so much as a bug fix request.

If the sanitization process is broken for HTML, then better sanitization is required.

I’m seeing that I cannot name an item <script> as it causes the following red notice to appear:

“We couldn’t add item, text can’t contain ‘<’ sign”

If however you add <div> as an item name, not only does it accept it silently, but appends </div> to make <div></div> (other html tags are also “autocompleted”):

Some other HTML tags such as <header> and <nav> give the same red error and message.

This is clearly a bug, not a feature.

2 Likes

Hello there @michael.le,

I have set this as a request!

Hello @dvdsmpsn,

Everything is probably connected to the sanitization mechanism, but I believe Michael’s issue is different from yours. He would like for the system not to create closing tags. You are seeing na issue when using as the name. We can take a look into that as well. Would you be able to please send us an email to support@monday.com so that the relevant team can take a look into it?

2 Likes