Is it possible to customize Goldmark's Typographer substitutions?

As mentioned here?

1 Like

Would love to know if this is possible as well.

I need left and right quotes reversed for an RTL language. Like ”this“.

I’m currently achieving this using replaceRE

{ .Content | replaceRE `“(.+?)”` "”$1“" | safeHTML }}

I’d like to have a mechanism for customizing the Typographer substitutions as well.

In my case it’s because of its approach to dashes, where it transforms -- to an en-dash and --- to an em-dash. That’s a defensible way of handling both dashes, but in my content there are lots of instances of “--” where the author was intending an em-dash, so replacing it with an en-dash is just wrong. (This is all US-English content; in UK English em-dashes are in fact commonly represented by the en-dash character.)

I’d rather replace -- with an em-dash and have authors manually insert en-dashes when necessary. I can’t use the replace or replaceRE functions because the content is already transformed by the Typographer extension by the time functions on .Content run. (I could find and replace all en-dashes with em-dashes, but then that would also replace the ones intentionally inserted by authors.) And I don’t want to turn off Typographer entirely as it does a nice job transforming single and double-quotes based on context.

Anyway, would be really nice to be able to set these options in config somewhere.