In #38 I changed the rendering process to use a modified version of the markdown2 library. But actually, I now think there's a better solution that doesn't require changing the library (markdown should stay markdown):
Take file
Read into beautifulsoup
Split out the custom <x-...> tags and render them separately
Render the rest of the text as Markdown by default
Merge the Markdown-rendered stuff with the custom-rendered stuff
If desired, we could even have <x-markdown> tag and <x-html> tags, for example, but that would require migrating all existing posts and I think default-Markdown rendering is a good idea.
This should also fix #40
Put this rendering code together into a separate Python module that we can import into both the backend and the CLI.
In #38 I changed the rendering process to use a modified version of the
markdown2
library. But actually, I now think there's a better solution that doesn't require changing the library (markdown should stay markdown):beautifulsoup
<x-...>
tags and render them separatelyIf desired, we could even have
<x-markdown>
tag and<x-html>
tags, for example, but that would require migrating all existing posts and I think default-Markdown rendering is a good idea.This should also fix #40
Put this rendering code together into a separate Python module that we can import into both the backend and the CLI.