-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Publish" call fails when page names have >=4(3?) white spaces #5
Comments
Hey again! Unfortunately I can't replicate the issue even with your "PAGE NAME WITH A BUT-LOAD OF WHITE SPACES" :/ I am using PowerShell 5.1.19041.1682. Would you mind testing with the latest version of My first impression was that it must have to do with how arguments are passed to Publish-OneNotePage in |
I just realized today that notebooks with spaces in their names would cause an error when exporting, because the path to the media folder of each notebook/section was passed to pandoc unquoted. As command line applications separate their arguments with spaces, paths with spaces in them need to be passed between quotes. Commit ef5089f ensures this. This should make |
I have finally managed to replicate the error, but with a ridiculously long note title: "Lossless Convexification of a Class of Optimal Control Problems with Non-Convex Control Constraints". I got the following error trace when trying to export:
After some research and judging from the I then deleted the last few words in the title and tried again, and it worked. I am fairly certain the cause of this issue is the maximum number of characters allowed in Windows paths. I suggest you try exporting your notes inside a directory "closer" to As to the numbers in the In the meantime, I consider this issue to be closed. |
Also using the same config as in #3
The final issue appears with both
$conversion = 'markdown-...'
and$conversion = 'markdown_github-...'
anytime a page has at least 4 white spaces in its name (not fully tested the minimum replication requirements, it could perhaps be present with as low as 3 spaces). This issue only affects the .docx to .md generation (thus with .pdf outputs remaining fine) and is accompanied by the following error message:Failed to convert page: SectionGroup\Section\“PAGE NAME WITH A BUT-LOAD OF WHITE SPACES”. Reason: Error while publishing page to docx file path\{...}{...}{...}-123456-“PAGE NAME WITH A BUT-LOAD OF WHITE SPACES”.docx: Exception calling "Publish" with "4" argument(s): "Exception from HRESULT: 0x80042006" Convert-OneNotePage : Failed to convert page: SectionGroup\Section\“PAGE NAME WITH A BUT-LOAD OF WHITE SPACES”. Reason: Error while publishing page to docx file....: Exception calling "Publish" with "4" argument(s): "Exception from HRESULT: 0x80042006"
Here, there's clearly something wrong with the Publish call whenever the name has multiple white spaces, resulting in space-flanked page name substrings to be parsed as additional arguments to the function call.
Thanks again for everything @alopezrivera ! 🥇
The text was updated successfully, but these errors were encountered: