smart-quotes fails when surrounding pollen markup
#157
Closed
opened 6 years ago by clozach
·
1 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?
Encountered this issue while working through the tutorial.
Steps to reproduce
pollen.rkt
article.html.pm
output
With this carefully-prepared example, the quotes surrounding the two
◊coded
words just remain "dumb" quotes.Even if the above behavior is intentional (and if it is, what's the workaround if one actually wants pretty quotes around markup?), the example below demonstrates a definite bug whereby smart-quotes seems to be only partially applied.
pollen.rkt
article.html.pm
output
Note the opening curly-single-quote after
<code>content</code>
.The behavior is correct. If you want
smart-quotes
to handle quotes that span multiple elements, you need to attachsmart-quotes
todecode-elements
as a#:txexpr-proc
, not as a#:string-proc
.Consider what’s happening in this X-expression:
The
p
has five elements — three strings and two tagged X-expressions (each of which contains a string). If you use#:string-proc
, thensmart-quotes
processes each of these five strings individually (and consequently doesn’t see any pairs of quotes). Whereas when you use#:txexpr-proc
, it looks at thep
tag as a whole, and then notices the pairs.