Allow customizing reading of #+INCLUDE files

It's not always sensible to allow #+INCLUDE of arbitrary files (e.g. user
provided content)
This commit is contained in:
Niklas Fasching 2019-10-03 23:42:26 +02:00
parent 2347800922
commit 9de65240a0
2 changed files with 8 additions and 6 deletions

View file

@ -127,7 +127,7 @@ func (d *Document) newInclude(k Keyword) (int, Node) {
path = filepath.Join(filepath.Dir(d.Path), path)
}
resolve = func() Node {
bs, err := ioutil.ReadFile(path)
bs, err := d.ReadFile(path)
if err != nil {
d.Log.Printf("Bad include %#v: %s", k, err)
return k