Error in rendering typographic quotes #17

Closed
opened 10 years ago by chipotle · 5 comments
chipotle commented 10 years ago (Migrated from github.com)

I've been playing a bit with Pollen, and have a fairly long novella already in Markdown. One of the paragraphs in the story (in a .html.pmd file) is as follows:

He lifted his brows and laughed. "I hadn't thought of it that way, but yes. I
see." Then he tilted his head, smiling curiously. "'Reductive.' You're very
well-spoken."

This is rendered by Pollen to the following:

<p>He lifted his brows and laughed. &ldquo;I hadn&rsquo;t thought of it that
way, but yes. I see.&rdquo; Then he tilted his head, smiling curiously.
"&lsquo;Reductive.&rsquo; You&rsquo;re very well-spoken."</p>

This may be a bug in the smart-quotes function.

(define line "He lifted his brows and laughed. \"I hadn't thought of it that
way, but yes. I see.\" Then he tilted his head, smiling curiously.
\"'Reductive.' You're very well-spoken.\"")
(display (smart-quotes line))
He lifted his brows and laughed. “I hadn’t thought of it that way, but yes. I
see.” Then he tilted his head, smiling curiously. "‘Reductive.’ You’re very
well-spoken.”

Then again, that might actually be a different bug -- smart-quotes seems to be getting the closing double quote right there, but not the opening one. (I don't know if the typography in Markdown is being run through the functions in the render module; I see my -- dashes are being rendered as em dashes, not en dashes.)

I've been playing a bit with Pollen, and have a fairly long novella already in Markdown. One of the paragraphs in the story (in a `.html.pmd` file) is as follows: ``` md He lifted his brows and laughed. "I hadn't thought of it that way, but yes. I see." Then he tilted his head, smiling curiously. "'Reductive.' You're very well-spoken." ``` This is rendered by Pollen to the following: ``` html <p>He lifted his brows and laughed. &ldquo;I hadn&rsquo;t thought of it that way, but yes. I see.&rdquo; Then he tilted his head, smiling curiously. "&lsquo;Reductive.&rsquo; You&rsquo;re very well-spoken."</p> ``` This may be a bug in the `smart-quotes` function. ``` racket (define line "He lifted his brows and laughed. \"I hadn't thought of it that way, but yes. I see.\" Then he tilted his head, smiling curiously. \"'Reductive.' You're very well-spoken.\"") (display (smart-quotes line)) He lifted his brows and laughed. “I hadn’t thought of it that way, but yes. I see.” Then he tilted his head, smiling curiously. "‘Reductive.’ You’re very well-spoken.” ``` Then again, that might actually be a different bug -- `smart-quotes` seems to be getting the _closing_ double quote right there, but not the opening one. (I don't know if the typography in Markdown is being run through the functions in the `render` module; I see my `--` dashes are being rendered as em dashes, not en dashes.)
mbutterick commented 10 years ago (Migrated from github.com)

I think you're right on both counts. Smart-quote conversion for Markdown is handled by @greghendershott’s Markdown parser, and it seems to be getting the nested quotes wrong (I’ve posted an issue there: greghendershott/markdown#45)

Meanwhile, the smart-quotes function in Pollen is missing the double quote that comes before the single quote. I see the problem and I will fix it.

I think you're right on both counts. Smart-quote conversion for Markdown is handled by @greghendershott’s Markdown parser, and it seems to be getting the nested quotes wrong (I’ve posted an issue there: greghendershott/markdown#45) Meanwhile, the `smart-quotes` function in Pollen is missing the double quote that comes before the single quote. I see the problem and I will fix it.
mbutterick commented 10 years ago (Migrated from github.com)

Fixed here.

Fixed here.
mbutterick commented 10 years ago (Migrated from github.com)

This has been fixed in the underlying markdown package too.
To get both fixes do raco pkg update --update-deps pollen.

This has been fixed in the underlying markdown package too. To get both fixes do `raco pkg update --update-deps pollen`.
greghendershott commented 10 years ago (Migrated from github.com)

@chipotle To ensure it updates the markdown package you might need to use --update-deps with that:

raco pkg update --update-deps pollen
@chipotle To ensure it updates the `markdown` package you might need to use `--update-deps` with that: ``` raco pkg update --update-deps pollen ```
chipotle commented 10 years ago (Migrated from github.com)

Thanks! I'm wryly amused I managed to hit an edge case in my very first use, but I guess that's a good thing. :)

Thanks! I'm wryly amused I managed to hit an edge case in my very first use, but I guess that's a good thing. :)
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mbutterick/pollen#17
Loading…
There is no content yet.