msnoigrs / ox-rst

reStructuredText Back-End for Org-Mode Export Engine
116 stars 18 forks source link

links to other ".org" files not exporting correctly #34

Closed jtoss closed 5 years ago

jtoss commented 7 years ago

Hi, I noticed that links to other ".org" files are not correctly exported: [[file:somefile.org]] is exported to 'somefile. <somefile.>'_

Normally we would expect it to create something like 'somefile.rst <somefile.rst>'_ right ?

jtoss commented 7 years ago

For the moment I'm using the following workaround to fix this issue. Just put this code into your init.el


(defun fix-rst-link-format (text backend info)
  "Temporary fix for bug https://github.com/masayuko/ox-rst/issues/34"
  (when (org-export-derived-backend-p backend 'rst)
    (replace-regexp-in-string "\\(\\.\\)>"  ".rst" 
                              (replace-regexp-in-string "\\(\\.\\) <"  ".rst" text nil nil 1) 
                  nil nil 1)))

(add-to-list 'org-export-filter-link-functions
             'fix-rst-link-format)
msnoigrs commented 5 years ago

Sorry for long silence.