Skip to content
Discussion options

You must be logged in to vote
if (node?.position && node.position.start.line === node.position.end.line) {
		return <code className="bg-blue-100 rounded-md py-1 px-1">{children}</code>;
	}

	return (
		<div>
			<div className="flex justify-between items-center bg-gray-800 h-8 px-4 rounded-t-md">
				<span className="text-gray-300 text-sm">{language || "text"}</span>
				<button
					className="text-sm text-white py-1 px-2 rounded-md hover:bg-gray-600 transition-colors"
					onClick={handleCopy}
				>
					{isCopied ? "✓ 复制成功" : "复制"}
				</button>
			</div>
			<SyntaxHighlighter
				style={vscDarkPlus}
				language={language}
				PreTag="div"
				customStyle={{
					borderRadius: "0 0 8px 8px",
					padding: "16px",
	…

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@Waterkyuu
Comment options

@JounQin
Comment options

JounQin Mar 19, 2025
Collaborator

@Waterkyuu
Comment options

@Waterkyuu
Comment options

Answer selected by Waterkyuu
@lvlingxiao1
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants