Hey @Cody Iddings, Emily here from Support Engineering at Intercom 👋🏼
You’re encountering a common issue when editing Intercom articles via the API: Intercom’s API may modify or strip certain HTML elements (like empty <p class="no-margin"></p> tags) when you update articles, which can break your intended formatting and spacing.
Key points and suggestions:
- When you retrieve an article using the API, you get the HTML as Intercom renders it, including their wrapper divs and spacing. However, when you update or create an article via the API, Intercom may sanitize or alter the HTML, especially removing empty tags or unsupported classes, which can affect layout and spacing.
- There are no official guidelines for specific HTML classes or patterns that Intercom guarantees to preserve. The API accepts HTML in the "body" attribute, but you may need to experiment with different markup to see what is retained after an update.
- To better understand what formatting is supported, you can use the "Retrieve an Article" API endpoint to inspect how Intercom stores and returns your content. This can help you identify which HTML elements and classes are preserved and which are stripped out.
- If you want to maintain specific spacing, consider using non-empty elements or supported inline styles, as empty paragraphs or custom classes may be removed by Intercom’s sanitization process.
There are no documented workflows that guarantee preservation of all original formatting when round-tripping articles via the API. You may need to adjust your HTML or post-process the content after retrieval to ensure consistent appearance.
Hi @Emilygav that quite unfortunate! Makes for quite difficult and time consuming workflows! is there any expectation for this to change?