Skip to content

feat(ui): add better code snippet and external link in Markdown#882

Merged
kapetr merged 1 commit intomainfrom
ui/markdown-code-snippet
Jul 7, 2025
Merged

feat(ui): add better code snippet and external link in Markdown#882
kapetr merged 1 commit intomainfrom
ui/markdown-code-snippet

Conversation

@PetrBulanek
Copy link
Contributor

No description provided.

Signed-off-by: Petr Bulánek <bulanek.petr@gmail.com>
@PetrBulanek PetrBulanek requested a review from kapetr July 3, 2025 14:32

interface Props extends HTMLAttributes<HTMLElement> {
forceExpand?: boolean;
hideCopyButton?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

let's name it canCopy

export function remarkExternalLink() {
return (tree: Root) => {
visit(tree, 'link', (node: Link) => {
if (isAbsoluteUrl(node.url)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

How about isExternalUrl?


setTimeout(() => {
setCopied(false);
}, 2000);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer this as a named constant.

@kapetr kapetr merged commit 2f134a1 into main Jul 7, 2025
7 checks passed
@kapetr kapetr deleted the ui/markdown-code-snippet branch July 7, 2025 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants