pinoaffe / org-vcard

Export and import vCards from within GNU Emacs' Org mode.
61 stars 7 forks source link

Inlining the icon property causes `org-element--current-element: Stack overflow in regexp matcher` #35

Open NightMachinery opened 2 years ago

NightMachinery commented 2 years ago

I get the error org-element--current-element: Stack overflow in regexp matcher when I activate org-mode on the imported file. I think this happens because the images are just put in an orgmode property named :icon:. Can't we put the images into separate files and link to them?

flexibeast commented 2 years ago

Yes, the vCard specs allow a URL/URI to be used as the value of PHOTO. However, that address needs to be globally accessible, not just locally accessible. That is, the resource at that address must be accessible from wherever the vCard is accessed. file:///home/user/image.jpg might be a valid address on one's Linux laptop, but not on one's Windows machine or iPhone. vCard-utilising software can choose to avoid this issue by simply Base64-encoding the image. So org-vcard needs to be able to handle being given such data.

org-vcard could certainly decode the Base64 data it's been given, generate a unique file name for the data, save it, and add a link in the generated Org file, as well as do all that in reverse when exporting (which it would need to do in order to avoid the above 'globally accessible address' issue). However, given the error you reported, there might actually be a bug to be addressed in org-element (which is part of Org, not org-vcard). Could you please M-x toggle-debug-on-error, reproduce the error, and then paste the entire resulting backtrace here? And could you also please report the value of the org-version variable?