Sean Allred
Sean Allred

Reputation: 3658

Org-mode won't parse dashes correctly when exporting to HTML

When exporting an org-mode to HTML, orphaned double-dashes formed during fill-paragraph don't export correctly as a single, longer dash in the HTML (like all the others do). Is there a way to fix this?

For example,

Lorem -- ipsum doler sit amet --
consectetur adipiscing elit

will export as

Lorem – ipsum doler sit amet -- consectetur adipiscing elit.

instead of

Lorem – ipsum doler sit amet – consectetur adipiscing elit.

Upvotes: 2

Views: 347

Answers (1)

Sean Allred
Sean Allred

Reputation: 3658

After fuddling around with it for (more than) a while, I found a workable solution. org-mode (or whatever it uses internally) seems to only parse the sequence -- (sandwiched by spaces, and not --, where there is no trailing space) as an –. Simply add this to your .emacs:

(add-hook 'org-export-preprocess-final-hook
          (lambda () (replace-string " --\n" " -- \n")))

Upvotes: 2

Related Questions