Description:
I am integrating OnlyOffice into my web application to render and edit DOCX files. Additionally, I have an AI chat assistant on the side that provides responses in Markdown and HTML format. However, I am facing an issue with maintaining formatting when users paste AI-generated responses into the OnlyOffice editor using Cmd + V (or Ctrl + V).
Issues:
- The AI responses come in Markdown format and are also available as HTML with proper tags (e.g.,
<h2>
,<strong>
,<ul>
). - I can successfully get the selected text in HTML format when copying from OnlyOffice. However, when I try to pass back an
<h2>
tag using the Paste HTML API, OnlyOffice does not retain the formatting as expected. - If users paste AI responses manually, the formatting (headings, bold, lists, etc.) is lost.
Questions:
- What is the best approach to preserve Markdown or HTML formatting when pasting into OnlyOffice?
- Are there specific configurations or APIs that allow me to insert formatted content properly?
- How can I ensure that the Paste HTML API maintains heading, bold, and list formatting when injecting AI responses?
Any guidance or best practices from the OnlyOffice team or community would be greatly appreciated!
Thanks!