I'm working on a custom content loader for taking word documents and converting them to markdown. The current setup converts them from .docx to .html and then the .html is converted to markdown.
Adding them to the store looks like this:
// this happens inside of a node:glob, using mammoth.js and turndown for the conversion pipeline
for await (const match of matches) {
const { value, messages } = await mammoth.convertToHtml({ path: match }, { styleMap: options.styleMap });
if (messages.length) {
messages.forEach((msg) => {
logger.info(msg.message)
});
}
const id = getId(match);
const data = {
match,
id,
};
const digest = generateDigest({
id,
body: service.turndown(value),
data
});
store.set({
body: service.turndown(value),
id,
digest,
data
})
}
The docs made it seem like if there was a body with a valid markdown, then running render(entry) would give the Content, headings, etc. But when I run <Content /> it renders no html.