Enable German quotation marks in Blackfriday?

Hey!
Is there any way to enable Blackfriday to use a different type of quotation marks when rendering Markdown files?

In Germany we use quotation marks like this: „Some quotation here.“
France uses them like this, I think: « Some quotation here. »

I wonder if there’s an option to render normal quotation marks as the typographically correct quotation marks automatically or if I have to use the corresponding Unicode characters in my Markdown.

Best regards
Florian

I believe you must use them in your Markdown. There’s no magical option to replace your quotation marks in Blackfriday. It’s not clear what you’re trying to do, but sometimes the replaceRE function feels magical.

1 Like

replaceRE looks good, I will have a closer look at that.

Blackfriday (and Hugo) supports “auto” French quotes and “normal” typographically correct quotation marks, but not German (first time I heard about those) …

1 Like

Maybe CSS is an option:

q, 
blockquote {
    quotes: "„" "“" "‚" "‘";
}

q:before,
blockquote:before {
    content: open-quote;
}
q:after,
blockquote:after {
    content: no-close-quote;
}

You can even define language specific styles:

html[lang="de"] q {
…
}

Personally I use correct quotation marks in the markdown files. As the are unambiguous replacing them e.g. with guillemet using replaceRE is a lot easier than replacing code quotation marks.

<pedant alert!>
Sadly, what has become regarded as ‘normal’ quotation marks for many languages is only really correct for US English, i.e. the 66-99 style of quote. In recent years this is mainly due to the ubiquity of MS-Word defaulting to the US style regardless of language, but historically dates back to manual typewriters and early photo-typesetting systems (and thus computer keyboards) not having room for alternative quote marks. This Wikipedia page documents many of the language specific variations.

Now that we have essentially unlimited character complements in Unicode fonts coupled with the advanced typographical features of OpenType it would be nice to see a return to ‘correct’ language specific quote marks (amongst other typographical niceties) being not only supported, but encouraged, in more types of software.
</pedant alert!>

2 Likes

I don’t understand why "Test" doesn’t render to <q>Test</q>. Then it would be easy to get German quotation marks with

q {
	quotes: '„' '“';
}

Is there no possibility to enable it? I’ve seen this functionality in Pandoc.

Summary

Solution 1: Write the German quotations marks explicitly

test.md

Ich bin nur ein „Test“.

Solution 2: Write the q-tags explicitly

test.md

Ich bin nur ein <q>Test</q>.

I think in your config.toml you have to put

[markup]
  [markup.goldmark]
    [markup.goldmark.renderer]
      unsafe = true

if you use the new Goldmark renderer.

And of course you have to style the q-tag in your CSS accordingly.

Solution 3: Use some Regex

test.md

Ich bin nur ein "Test".

partials/quotation-marks.html

{{ . | replaceRE "(\s\")(.*?)(\")" "<q>${2}</q>" | safeHTML }}

(DOESN’T WORK. MAYBE SOMEONE KNOWS HOW TO FIX THIS?)

and somewhere (for example in your baseof.html) you include the partial with

{{ partial "quotation-marks.html" .Content }}

And of course you have to style the q-tag in your CSS accordingly.

Other solution

You could define a shortcode.

shortcodes/q.html

<q>
    {{ .Inner }}
</q>

But I think something like

Ich bin nur ein {{< q >}}Test{{< /q >}}.

looks horrible.