Skip to content

What's the best way of handling body formats for long text documents? #564

Discussion options

You must be logged in to vote

This looks reasonable to me. I wonder if simple_format has been misclassified as a “value helper” rather than an “output helper” in the SimpleFormat adapter. If simple_format is considered HTML safe (I assume it only allows safe HTML but will need to confirm this), we could make the unsafe_raw call in the adapter itself.

You may want to consider making the body an argument rather than a method. The interface could then be:

render Document.new(<<~TEXT)
  Document text here.
TEXT

You may also want to look into the phlex-markdown gem, which I created while building the phlex documentation site. This is very much still in beta and subject to change, but it’s also incredibly simple, so there’s…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mattiasgullstrand
Comment options

Answer selected by mattiasgullstrand
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants