Desktop: OneNote importer: Add partial support for importing internal links #13926
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This pull request adds partial support for importing internal OneNote links. In particular, internal links can be imported if they have a
page-idthat points to the NotebookManagementEntityGuid in the metadata for the imported page revision.This pull request works by 1) including the NotebookManagementEntityGuid for each page in the rendered output and 2) using the NotebookManagementEntityGuid to resolve
onenote:links to file paths during the import process.Notes
This does not allow the internal link from #13549 to be imported. Although that link specifies a
page-id, thepage-iddoes not seem to match an ID in the imported page metadata. There does exist a page metadata object with a matching ID in the.onefile, but it is not imported (perhaps it's associated with an earlier page revision?).Further debugging will be necessary to determine why the internal link in #13549's test file points to page metadata that doesn't seem to be associated with an imported page.
Testing
An existing test file (used in the "should remove hyperlink from title" test) includes an internal link that is now imported successfully.