Hello, Kaushal Modi <[email protected]> writes:
> Though I didn't understand why it failed when exporting from the large > file, but not when moving the relevant subtrees (where the #+include was > called, and the included) to a separate file.. The code was fixing links in the whole document, not only in the subtree you were including. The problem lay somewhere else in the file, in the "* Hey! I have a link [[https://example.org][here]] (Awesome!)" headline. There, `org-element-context' needed to check the headline, by (looking-at org-complex-heading-regexp). However, since the changes were happening in Fundamental mode, the regexp was not set. Hence the error. So, the fix implements the following changes: - only modify links withing the included part of the document, - do not modify anything if includer and includee both live in the same directory, - switch to Org mode before proceeding with changes. Regards, -- Nicolas Goaziou
