alxnbl / onenote-md-exporter

ConsoleApp to export OneNote notebooks to Markdown formats
GNU General Public License v3.0
892 stars 74 forks source link

Images not being exported for Notebook with apostrophe #90

Closed J-SHarper closed 9 months ago

J-SHarper commented 1 year ago

Describe the bug Images are not being exported for some reason. To Reproduce

Steps to reproduce the behavior. Attempt to export any of my notebooks. All of the images fail with the below error. No other errors are logged.

Expected behavior I hoped images would be exported.

Logs Here is the error: [15:49:21 WRN] Page 'Joshua's Notebook\Quick Notes\Photo IMG_8689': Error while extracting images of the page. Nothing else seems out of the ordinary. Happy to private message the logs file to anyone who can help.

Desktop (please complete the following information):

Additional context Failed across all of my notebooks.

alxnbl commented 1 year ago

Thank for your report. Sorry but I will be very busy the next few months and will not be able to have a look to the issue. Hopefully, a kind contributor will take a look at your problem.

mgelmantech commented 1 year ago

I found that removing the apostrophe (i.e. "Michaels's Notebook" -> "Michaels Notebook") fixed this issue for me. I suspect there's something going on with the character conversion in the path somewhere but I was unable to track it down in the short period of time I had to look at it.

alxnbl commented 1 year ago

Thanks a lot a for the feedback. I will try to solve the issue in the next version of the tool*.

alxnbl commented 1 year ago

Related to #80

alxnbl commented 12 months ago

I did not managed to reproduce the bug. Do you mind to send me a sample Onenote notebook that cause the crash to append ? Thanks

armstrong-pv commented 9 months ago

Hi, I created a PR fix for this, as it happened with my notebook, titled: Paul's Notebook. I think any 'special' HTML character would cause the issue, as attachment paths were being translated like this: C:\\Users\\Paul\\AppData\\Local\\Temp\\Paul's Notebook\\pandoc\\media\\image1.png PR fix: https://github.com/alxnbl/onenote-md-exporter/pull/96 The export would fail on every page that had image attachments, but now they all export successfully. Error report from the app:

Page 'Paul's Notebook\Linux\Useful Linux Commands': Error while extracting images of the page.
Page 'Paul's Notebook\Linux\Useful Linux Commands': Error during processing of page Useful Linux Commands [0ce9933751154deebed4b53d4965adcb]. Page ignored. Error message : Could not find file 'C:\Users\Paul\Downloads\OneNoteMdExporter.v1.3.0\Exports\joplin-raw-dir\Paul's Notebook-20231206 12-47\Paul's Notebook\resources\4bc83c35935f4425a7a68b3ae88d951b.png'

And great tool by the way! Not sure what I would have done without it 🙏 Now I have to reimport the folder into Joplin. Since my first import excluded pages with images, I'm hoping I can just reimport and the new content will magically turn up and not screw existing content / create duplicates. Gulp...

alxnbl commented 9 months ago

Thanls a lot for the PR, I will review it as soon as possible.

alxnbl commented 9 months ago

Thanks again to reproduce and fix the bug @armstrong-pv ! The fix is embedded in version 1.4.