Looking for advice on processing linebreaks
#96
Closed
opened 4 years ago by achuie
·
2 comments
Loading…
Reference in New Issue
There is no content yet.
Delete Branch '%!s(<nil>)'
Deleting a branch is permanent. It CANNOT be undone. Continue?
I've just been through the tutorials, and I've thoroughly enjoyed them and am excited to make stuff with Pollen and Racket. Kudos for all the hard work here!
I've used LaTeX in the past, and I really like the
\\
command to indicate a linebreak, instead of Pollen'sdecode-linebreaks
, because it helps to control line lengths in the source file while letting CSS reflow the final output. I have an implementation below, which leveragesdecode-elements
onroot
, but it requires two passes because the string operations to trim the\\
happen before the txexpr element operations, so the'(br)
substitution fails to trigger in one pass. I'm looking for advice, on everything from a better approach to the processing to better code style, as I'm new to Racket. Thanks for taking a look!There’s nothing wrong with nesting multiple calls to
decode-elements
. For instance, see theroot
tag function in thepollen-tfl
sample code. On the contrary, it can often be easier to reason about these transformations by putting them into multiple passes.Ok cool, thanks for the feedback! Closing as there seems not to be any further discussion necessary.