ToHTML() or ToMarkup() Function for strings

One way to achieve this is to manipulate the inner object structure.

Each formatted cell has:

  • multi-line text (delimited by \n)
  • info about spans (for span-level formatting like bold and color)
  • info about lines (for paragraph-level formatting like list type)

so with enough tenacity it’s possible to compose HTML/Markdown out of a formatted cell.

Here’s one example of manipulating inner object structure:

Also cross-doc pulls in formatted text as markdown (I’m not 100% sure though, but I remember seeing some evidence of that); so by examining inner object structure perhaps it’s possible to extract markdown and convert to HTML with any markdown-to-HTML converter.

3 Likes