cheapskate icon indicating copy to clipboard operation
cheapskate copied to clipboard

Serialize `Doc` back into a `Text` value

Open tysonzero opened this issue 5 years ago • 0 comments

We are sometimes using cheapskate to parse existing markdown, but other times we are using it to generate markdown of our own instead of concatenating a bunch of strings. The downside is that once you have a Doc, there doesn't seem to be a way to get the underlying Text back, for things like storing it in a database or passing it into text editors.

A render :: Doc -> Text function would be fantastic, although maybe Blocks -> Text would be more appropriate as the Options payload in Doc seems irrelevant when you aren't rendering to HTML.

tysonzero avatar May 14 '19 04:05 tysonzero