wormi4ok/evernote2md

Export file could generate unsafe paths to images

Closed this issue · 4 comments

Hi, thank you for very useful and simple to use program!

I had an issues with converting and it probably related to unsafe image paths in dump

open ./result/image/favicons?domain=http://www.dolunaytravel.com/images/slider/principles/4.jpg: no such file or directory
open ./result/image/assets.github.com/images/gravatars/gravatar-140.png.jpg: no such file or directory

Hello @dimanech,

This is an interesting case, I never used such image links. Could you please share an .enex file with a single note using an image with an unsafe path?

I'd like to create a test case for this issue.

Thank you!

I could not upload full dump of notes since it around 1.2Gb xml. This note that cause error:

<note><title>Free Mac client for Git, Mercurial and SVN - Atlassian SourceTree</title><content><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd">
<en-note><span><img title="Free Mac client for Git, Mercurial and SVN - Atlassian SourceTree" style="display:inline;border: none; width: 16px; height: 16px; padding: 0px; margin: 0px 8px -2px 0px;" src="http://sourcetreeapp.com/favicon.ico"/><a shape="rect" title="Free Mac client for Git, Mercurial and SVN - Atlassian SourceTree" style="font-size: 12pt; line-height: 18px; display: inline;" href="http://sourcetreeapp.com/">http://sourcetreeapp.com/</a></span></en-note>]]></content><created>20130228T154918Z</created><updated>20130228T154918Z</updated><note-attributes><source>web.clip</source><source-url>http://sourcetreeapp.com/</source-url><reminder-order>0</reminder-order></note-attributes></note>
<note><title>4.jpg (1600×1200)</title><content><![CDATA[<?xml version="1.0" encoding="utf-8"?><!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd"><en-note><br/><div style="position: relative;"><div style="white-space: nowrap;"><div style="font-family: Helvetica, Arial, sans-serif; font-size: 14px; font-weight: bold; color: rgb(12, 12, 12); overflow-x: hidden; text-overflow: ellipsis; padding-bottom: 9px;">4.jpg (1600×1200)</div><div style="border-top-width: 1px; border-top-style: solid; border-top-color: rgb(216, 216, 216); height: 0px; width: 100%;"></div><div style="display: inline-block; vertical-align: top; margin: 15px 0px 0px; width: 364px;"><div style="font-family: Helvetica, Arial, sans-serif; font-size: 12px; color: rgb(12, 12, 12); display: block;"><div style="display: inline-block; border: none; width: 16px; height: 16px; padding: 0px; margin: 0px 8px -2px 0px;"><en-media type="image/png" hash="b8a0bf372c762e966cc99ede8682bc71" height="16" width="16"></en-media></div><a href="http://www.dolunaytravel.com/images/slider/principles/4.jpg" style="display: inline-block; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: rgb(12, 12, 12); width: 345px;">http://www.dolunaytravel.com/images/slider/principles/4.jpg</a></div></div></div></div><br/></en-note>]]></content><created>20131229T225922Z</created><updated>20131229T225922Z</updated><tag>retina</tag><tag>device width</tag><note-attributes><source>web.clip</source><source-url>http://www.dolunaytravel.com/images/slider/principles/4.jpg</source-url><reminder-order>0</reminder-order></note-attributes><resource><data encoding="base64">iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsSAAALEgHS3X78AAACiElE
QVQ4EaVTzU8TURCf2tJuS7tQtlRb6UKBIkQwkRRSEzkQgyEc6lkOKgcOph78Y+CgjXjDs2i44FXY9AMT
lQRUELZapVlouy3d7kKtb0Zr0MSLTvL2zb75eL838xtTvV6H/xELBptMJojeXLCXyobnyog4YhzXYvmC
Fi6qVSfaeRdXdrfaU1areV5KykmX06rcvzumjY/1ggkR3Jh+bNf1mr8v1D5bLuvR3qDgFbvbBJYIrE1m
CIoCrKxsHuzK+Rzvsi29+6DEbTZz9unijEYI8ObBgXOzlcrx9OAlXyDYKUCzwwrDQx1wVDGg089Dt+gR
3mxmhcUnaWeoxwMbm/vzDFzmDEKMMNhquRqduT1KwXiGt0vre6iSeAUHNDE0d26NBtAXY9BACQyjFusK
uL2Ry+IPb/Y9ZglwuVscdHaknUChqLF/O4jn3V5dP4mhgRJgwSYm+gV0Oi3XrvYB30yvhGa7BS70eGFH
PoTJyQHhMK+F0ZesRVVznvXw5Ixv7/C10moEo6OZXbWvlFAF9FVZDOqEABUMRIkMd8GnLwVWg9/RkJF9
sA4oDfYQAuzzjqzwvnaRUFxn/X2ZlmGLXAE7AL52B4xHgqAUqrC1nSNuoJkQtLkdqReszz/9aRvq90NO
KdOS1nch8TpL555WDp49f3uAMXhACRjD5j4ykuCtf5PP7Fm1b0DIsl/VHGezzP1KwOiZQobFF9YyjSRY
QETRENSlVzI8iK9mWlzckpSSCQHVALmN9Az1euDho9Xo8vKGd2rqooA8yBcrwHgCqYR0kMkWci08t/R+
W4ljDCanWTg9TJGwGNaNk3vYZ7VUdeKsYJGFNkfSzjXNrSX20s4/h6kB81/271ghG17l+rPTAAAAAElF
TkSuQmCC</data><mime>image/png</mime><width>16</width><height>16</height><duration>0</duration><resource-attributes><source-url>http://www.google.com/s2/favicons?domain=http%3A%2F%2Fwww.dolunaytravel.com%2Fimages%2Fslider%2Fprinciples%2F4.jpg</source-url><timestamp>19700101T000000Z</timestamp><file-name>favicons?domain=http://www.dolunaytravel.com/images/slider/principles/4.jpg</file-name></resource-attributes></resource></note>

Hey @dimanech,

Could you please try to run a patched release I just created and check if it fixes the problem?
https://github.com/wormi4ok/evernote2md/releases/tag/v0.5.0

Sorry for the late response, github not always show answers count properly.
I have tested v0.5.0 with my dump and it works great! Thanks very much for great tool!