HAR-9736 - fix link export (and url field)#532
Merged
harbournick merged 1 commit intomainfrom May 28, 2025
Merged
Conversation
a7844f3 to
bf89b63
Compare
artem-harbour
commented
May 28, 2025
|
|
||
| // Update the ID. If we've assigned a long ID (ie: images) we leave it alone | ||
| // Update the ID. If we've assigned a long ID (ie: images, links) we leave it alone | ||
| rel.attributes.Id = existingId.length > 6 ? existingId : `rId${++largestId}`; |
Contributor
Author
There was a problem hiding this comment.
This is the main issue why the links did not work when exporting. We create a new id for the link node every time, but we don't create a new relationship for this id.
Note:
- Previous relationships are not deleted, but this does not seem to be an issue. It can also be quite risky to delete prev relationships by checking the value. In any case, we can consider this later.
artem-harbour
commented
May 28, 2025
| return newNode; | ||
| } | ||
|
|
||
| function processLinkContentNode(node) { |
Contributor
Author
There was a problem hiding this comment.
Add default properties and color to the link node so it looks like a link in a document.
artem-harbour
commented
May 28, 2025
| const newId = addNewLinkRelationship(params, attrs.linkUrl); | ||
|
|
||
| const linkTextNode = getTextNodeForExport(attrs.linkUrl, marks, params); | ||
| const contentNode = processLinkContentNode(linkTextNode); |
Contributor
Author
There was a problem hiding this comment.
Same for url annotation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Added comments in the code (more details in the ticket).