/* Copyright 2026 Marimo. All rights reserved. */ import type { QuotePrefixKind } from "@marimo-team/smart-cells"; // Based on the current quote prefix and the checkbox state, return the new quote prefix export function getQuotePrefix({ currentQuotePrefix, checked, prefix, }: { currentQuotePrefix: QuotePrefixKind; checked: boolean; prefix: QuotePrefixKind; }) { let newQuotePrefix = currentQuotePrefix; if (checked) { // Add a prefix if (currentQuotePrefix === "") { newQuotePrefix = prefix; } else if (currentQuotePrefix !== "rf" && prefix !== currentQuotePrefix) { newQuotePrefix = "rf"; } } else { // Removing a prefix if (currentQuotePrefix === prefix) { // Removing the only prefix newQuotePrefix = ""; } else if (currentQuotePrefix === "rf") { newQuotePrefix = prefix === "r" ? "f" : "r"; } } return newQuotePrefix; } export const MarkdownQuotePrefixTooltip: React.FC = () => { return (
r
Raw String
Write LaTeX without escaping special characters
\alpha \beta
f
Format String
Interpolate Python values
Hello {"{name}"}! 😁