jkitchin / ox-clip

Copy formatted content from org-mode
67 stars 10 forks source link

Text with backslashes and formatting is cut when copied #3

Open ngleb opened 5 years ago

ngleb commented 5 years ago

I noticed that when I have something like this: *%appdata%\Path\Path\Path* then when I use ox-clip (either on Windows natively or on Linux), it will be copied without slashes, and everything after the backslash including the backslash will be cut. It doesn't happen if I replace it with regular slashes, but for Windows paths I would prefer the backslash.

So I get this (with formatting): %appdata%

It doesn't matter what text I have, I just noticed that in this particular case.

It happens with _underlined text here_, /italics text here/, *bold text here*, but not with ~code text here~ (so I use this one and then change the formatting in place).

I tried double-backslashes, but it didn't help.

jkitchin commented 5 years ago

I can confirm this is happening. I am not sure why though. your path is getting lost when the buffer is converted to html, and only because of (org-html-with-latex 'dvipng). It works better with dvisgm, but I am not sure why. I will look into it and try to push a fix later today.

jkitchin commented 5 years ago

I was wrong about what is happening. The issue is the \Path is getting interpreted as a Latex fragment and rendered accordingly. I am not sure what the best way to avoid this is. An ugly way is @@html:%appdata%\Path\Path\Path@@ assuming you were going for a bold path.

ngleb commented 5 years ago

I was wrong about what is happening. The issue is the \Path is getting interpreted as a Latex fragment and rendered accordingly. I am not sure what the best way to avoid this is. An ugly way is @@html:%appdata%\Path\Path\Path@@ assuming you were going for a bold path.

Hi! Thanks, it works!

So, is it possible to fix this at all? I think it might be a very rare case, but it may also be unnoticed which can cause problems for somebody. In this case at least a note in a readme file can be a good thing.

jkitchin commented 5 years ago

I am not sure if there is a way to suppress it. There probably is an org variable that could suppress it, but then you could not use this in other places. I asked on the org-list, but didn't hear anything. I think another option is to use == and ~~ so the path is verbatim.