Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions core/lib/server/render/pub/renderMarkdownWithPub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,14 @@ const renderMarkdownWithPubPlugin: Plugin<[utils.RenderWithPubContext]> = (conte
communityId: context.communityId,
pubId: context.pub.id as PubsId,
});
assert(isParent(node));
// Include default text
node.children = [
{
type: "text",
value: attrs.text ?? props.href,
},
];
Comment on lines +267 to +274

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is copied from

https://github.com/pubpub/platform/blob/974b002ee13d1d61accf775c06e13cf226dacd2d/core/lib/server/render/pub/renderMarkdownWithPub.ts#L168-L174

in visitLinkDirective. However, the href at this point is just an empty string because this defers the creation of the link to further down in the file

https://github.com/pubpub/platform/blob/974b002ee13d1d61accf775c06e13cf226dacd2d/core/lib/server/render/pub/renderMarkdownWithPub.ts#L261-L266

I'm not sure if there's a way we can reuse what was already there, but I'm guessing not since this exception for form links was already carved out.

}
}
})
Expand Down