# Why do my single and double quotes look different when I write in markdown?

**URL:** <https://discourse.gohugo.io/t/why-do-my-single-and-double-quotes-look-different-when-i-write-in-markdown/52140>\
**Category:** support\
**Created:** [October 26, 2024, 3:48pm UTC](https://discourse.gohugo.io/t/why-do-my-single-and-double-quotes-look-different-when-i-write-in-markdown/52140 "2024-10-26T15:48:03Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![zoliky](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/zoliky/32/10564_2.png) [@zoliky](https://discourse.gohugo.io/u/zoliky)\
**Post date:** [October 26, 2024, 3:48pm UTC](https://discourse.gohugo.io/t/why-do-my-single-and-double-quotes-look-different-when-i-write-in-markdown/52140/1 "2024-10-26T15:48:04Z")

</div>

Hello,  
I’ve noticed that my single and double quotes are rendered differently when I’m writing content in markdown. In Org format, both the apostrophes and double quotes looked fine, but after switching to markdown, they appear slightly tilted, almost like they’re in italics, even though I haven’t changed any font settings like size or type.

HTML output from Org syntax. It looks ok:

 ![a](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/3X/b/3/b30a67eeab132f6a26be46a24bb55816fc4f57e2.jpeg)

HTML output from Markdown:

 ![b](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/3X/6/5/6518b31edd630725dc538155202560b985d1339c.jpeg)

I’m wondering if there’s a setting that could make these characters appear straight rather than tilted.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [October 26, 2024, 3:50pm UTC](https://discourse.gohugo.io/t/why-do-my-single-and-double-quotes-look-different-when-i-write-in-markdown/52140/2 "2024-10-26T15:50:41Z")

</div>

[https://gohugo.io/getting-started/configuration-markup/#typographer](https://gohugo.io/getting-started/configuration-markup/#typographer)

You can either disable the typographer extension, or change the replacement character for single and double quotes.

This:

```plaintext
[markup.goldmark.extensions.typographer]
disable = true

```

Or this:

```plaintext
[markup.goldmark.extensions.typographer]
apostrophe = "'"
leftDoubleQuote = '"'
leftSingleQuote = "'"
rightDoubleQuote = '"'
rightSingleQuote = "'"

```

---

<div class="post-metadata">

**Author:** ![chrillek](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/chrillek/32/19797_2.png) [@chrillek](https://discourse.gohugo.io/u/chrillek)\
**Post date:** [October 26, 2024, 4:20pm UTC](https://discourse.gohugo.io/t/why-do-my-single-and-double-quotes-look-different-when-i-write-in-markdown/52140/3 "2024-10-26T16:20:18Z")

</div>

The output from org mode looks like an apostrophe to me, not like a single quote.

---

<div class="post-metadata">

**Author:** ![zoliky](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/zoliky/32/10564_2.png) [@zoliky](https://discourse.gohugo.io/u/zoliky)\
**Post date:** [October 26, 2024, 4:22pm UTC](https://discourse.gohugo.io/t/why-do-my-single-and-double-quotes-look-different-when-i-write-in-markdown/52140/4 "2024-10-26T16:22:36Z")

</div>

Thank you. Is there any reason the typographer is enabled by default, or is it just set that way based on preference?

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [October 26, 2024, 4:26pm UTC](https://discourse.gohugo.io/t/why-do-my-single-and-double-quotes-look-different-when-i-write-in-markdown/52140/5 "2024-10-26T16:26:32Z")

</div>

> [@zoliky](#):
>
> Is there any reason the typographer is enabled by default,

The default was set many years ago, presumably because more people wanted it enabled than disabled. Not sure.

---

<div class="post-metadata">

**Author:** ![zoliky](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/zoliky/32/10564_2.png) [@zoliky](https://discourse.gohugo.io/u/zoliky)\
**Post date:** [October 26, 2024, 4:31pm UTC](https://discourse.gohugo.io/t/why-do-my-single-and-double-quotes-look-different-when-i-write-in-markdown/52140/6 "2024-10-26T16:31:13Z")

</div>

I added it this way. I think I did it correctly, but I’m not sure.

`hugo.toml:`

```auto
[markup]
  [markup.goldmark]
    [markup.goldmark.extensions]
      [markup.goldmark.extensions.typographer]
        disable = true

  [markup.highlight]
    noClasses = false

```

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [October 26, 2024, 4:35pm UTC](https://discourse.gohugo.io/t/why-do-my-single-and-double-quotes-look-different-when-i-write-in-markdown/52140/7 "2024-10-26T16:35:10Z")

</div>

The first part is correct.

With this bit…

```auto
[markup.highlight]
noClasses = false

```

… you will need to generate a style sheet (using the `hugo gen chromastyles` command). If set to true (the default), syntax highlighted code blocks will use inline style attributes.

---

<div class="post-metadata">

**Author:** ![zoliky](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/zoliky/32/10564_2.png) [@zoliky](https://discourse.gohugo.io/u/zoliky)\
**Post date:** [October 26, 2024, 4:44pm UTC](https://discourse.gohugo.io/t/why-do-my-single-and-double-quotes-look-different-when-i-write-in-markdown/52140/8 "2024-10-26T16:44:36Z")

</div>

I have the stylesheet generated. In that case I can leave it as is, right?

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [October 26, 2024, 4:47pm UTC](https://discourse.gohugo.io/t/why-do-my-single-and-double-quotes-look-different-when-i-write-in-markdown/52140/9 "2024-10-26T16:47:03Z")

</div>

Yes, you can.

---

<div class="post-metadata">

**Author:** ![zoliky](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/zoliky/32/10564_2.png) [@zoliky](https://discourse.gohugo.io/u/zoliky)\
**Post date:** [October 26, 2024, 4:51pm UTC](https://discourse.gohugo.io/t/why-do-my-single-and-double-quotes-look-different-when-i-write-in-markdown/52140/10 "2024-10-26T16:51:19Z")

</div>

Sorry for posting this here. I have one last question, and I don’t want to open a new thread for it, even though that would have been more appropriate. I’ve noticed that some front matters use YAML syntax while others use TOML. Is this just a matter of preference? Can I use either one I want for posts? For example, I prefer the YAML format for all posts, but I left `hugo.toml` in TOML. However, I think the two can work together until I eventually switch the Hugo configuration to YAML at some point.

---

<div class="post-metadata">

**Author:** ![chrillek](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/chrillek/32/19797_2.png) [@chrillek](https://discourse.gohugo.io/u/chrillek)\
**Post date:** [October 26, 2024, 4:58pm UTC](https://discourse.gohugo.io/t/why-do-my-single-and-double-quotes-look-different-when-i-write-in-markdown/52140/11 "2024-10-26T16:58:49Z")

</div>

> [@zoliky](#):
>
> Is this just a matter of preference?

Yes, it is.

---

<div class="post-metadata">

**Author:** ![irkode](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/irkode/32/26135_2.png) [@irkode](https://discourse.gohugo.io/u/irkode)\
**Post date:** [October 26, 2024, 5:49pm UTC](https://discourse.gohugo.io/t/why-do-my-single-and-double-quotes-look-different-when-i-write-in-markdown/52140/12 "2024-10-26T17:49:52Z")

</div>

Mostly…dates are strings with yaml but date values with toml

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [October 26, 2024, 7:24pm UTC](https://discourse.gohugo.io/t/why-do-my-single-and-double-quotes-look-different-when-i-write-in-markdown/52140/13 "2024-10-26T19:24:16Z")

</div>

@irkode brings up the most important factor.

TOML has a date data type; YAML and JSON do not. The data type is irrelevant for the four predefined front matter date fields (`date`, `publishDate`, `expiryDate`, `lastmod`)… Hugo casts those fields to `time.Time` values.

But for _custom_ date fields (under the `params` key), quoted date values are strings. But with TOML, if you omit the quotes, it is unmarshaled to a date/time value. That makes date comparisons easier, in particular when using a `where` clause.

Front matter example:

```plaintext
+++
title = 'Post 1'
date = 2024-10-26T12:23:13-07:00
draft = false
[params]
eventDate = 2024-10-31T16:30:00-07:00
+++

```

More details:  
[https://gohugo.io/functions/collections/where/#date-comparison](https://gohugo.io/functions/collections/where/#date-comparison)

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [October 28, 2024, 7:25pm UTC](https://discourse.gohugo.io/t/why-do-my-single-and-double-quotes-look-different-when-i-write-in-markdown/52140/14 "2024-10-28T19:25:03Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
