Hi, we’re trying to pass the HTML for a standard ghost toggle card through the API. The html for the whole card works fine, aside from the div with class=‘kg-toggle-content’, for some reason the API is stripping the content out. We tried wrapping it in kg-card-begin: html but no difference. We tried plain content and content with html tags, still no luck.
Parsing from HTML into mobiledoc is quite a technical and tricky part of Ghost’s API. I can’t say for certain what’s going wrong (esp without seeing a full repro case), but I can direct you to the code that does the work:
Our parser plugins are what read HTML and try to build mobiledoc out of it. This code will show you what classes and nodes are expected in order to build a toggle card.
If you can’t get it to work, there may be a bug in that code?
It’s curious that the code treats the heading and the content differently, as it actually makes sending the content unnecessarily complicated e.g if it read contentNode.innerHTML I think it’d probably work.
Problem is we’re using the Ghost hosted version so not sure much I can do aside from hack around it?