0

When you export to html, -- is converted to en-rule and --- to em-rule. Is it possible to prevent this?

3

These conversions are defined by a set of regular expressions in file ox-export.el:

(defconst org-html-special-string-regexps
  '(("\\\\-" . "­")      ; shy
    ("---\\([^-]\\)" . "—\\1")   ; mdash
    ("--\\([^-]\\)" . "–\\1")    ; ndash
    ("\\.\\.\\." . "…"))     ; hellip
  "Regular expressions for special string conversion.")

So you could change them by redefining this value, after ox-export has been loaded (as defconst unconditionnaly sets the value). A possible way would be to add the following to your init file:

(eval-after-load 'ox-html
  '(setq org-html-special-string-regexps
    '(("\\\\-" . "­")        ; shy
      ("---\\([^-]\\)" . "---\\1")  ; mdash
      ("--\\([^-]\\)" . "--\\1")    ; ndash
      ("\\.\\.\\." . "…"))   ; hellip
    ))

That is, after ox-export has been loaded (and the variable set), we change its value.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.