Hi, Ihor, Here is a new fixed version of the patch, with the addition to NEWS. Ihor Radchenko writes: >> - (org-back-to-heading t) ; Sets match data >> - (match-end 0)) >> + (re-search-backward org-heading-regexp) ; Sets match data >> + (match-beginning 0)) > > This will err when the source block is before the first headline in the > document. I've reverted the first line to (org-back-to-heading t), keeping the (match-beginning 0), otherwise you don't get the full headline and all property drawers would be exported. But it's strange, it doesn't give me any error when the source block is before the first headline in the document. Isn't that error prevented with this: (condition-case nil ... (error (point-min))) ? By the way, I've noticed that it's not convenient to export numbered headers, so I've modified org-babel-export-comment-text-as-plain-text so that it removes header numbering. I don't know if it's ok to do it this way... Best regards, Juan Manuel