seattlerb/zenweb

smart quotes in markdown

Closed this issue · 4 comments

When I have a .html.md file, the quotes are converted to smartquotes and then look like garbage in the browser.

See this revision: https://github.com/srbaker/stevenrbaker.com/commit/314bf19b278b037c05a31b01d097fd99eb9c77ce

The generated version of this is (temporarily) available at: http://new.stevenrbaker.com/foo.html

Thanks!

I don't see what your generated version looks like.

I just wrote the following passing test:

  def test_render_md_content
    act = page.render_md page, "Here's a quote."
    exp = "<p>Here&rsquo;s a quote.</p>\n"

    assert_equal exp, act
  end

Is this not what you want? If not, is there a certain context in which you don't want it or what?

See email; I can't figure out how to put a frigging image attachment here.

I've got no repro. The text is rendering correctly. So it is either an encoding issue on the server/browser side or something not stated.

To be specific, I took the input from the test above and put it in a file named "blah.html.md". Twapped the yaml frontmatter on and ran rake sync. It looks fine. I had to verify the content against the raw file, not in safari because safari doesn't show the entities anymore, just the encoded character.

My main layout does have:

    {{ page.meta "contenttype", "content-type", "http-equiv" }}

in the head. But I took that out and it rendered the same.

Looking at the request:

10000 % curl -I http://www.zenspider.com/blah.html
HTTP/1.1 200 OK
Date: Thu, 27 Sep 2012 22:59:07 GMT
Server: Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/0.9.8r DAV/2
Last-Modified: Thu, 27 Sep 2012 22:37:14 GMT
ETag: "4dc055c-800-4cab694abfa80"
Accept-Ranges: bytes
Content-Length: 2048
Cache-Control: max-age=3600
Expires: Thu, 27 Sep 2012 23:59:07 GMT
Vary: Accept-Encoding
MS-Author-Via: DAV
Content-Type: text/html

so that part seems fine. Looking at Safari's View -> Text Encoding, I'm set to "default".

All in all, you're reporting a bug like a newb. :P

sigh