From d18bc20de89c3e7015f2ec9933067a011cb07eae Mon Sep 17 00:00:00 2001 From: Ev Haus Date: Wed, 29 Jan 2025 22:09:16 -0800 Subject: [PATCH] fix: Minor naming and comment fixes --- src/index.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index c8b2bda..8302748 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -60,7 +60,10 @@ const renderTextElement = ({ }; // Converts a web-based SVG element to a react-pdf SVG element -const webSvgToPdfSvg = (children: React.ReactElement, chartStyle?: Style) => { +export const convertHTMLToPDF = ( + children: React.ReactElement, + chartStyle?: Style, +) => { const svgString = renderToStaticMarkup(children); if (!svgString?.length) { @@ -358,7 +361,7 @@ const webSvgToPdfSvg = (children: React.ReactElement, chartStyle?: Style) => { * @example * * - * + * * * * @@ -367,7 +370,7 @@ const webSvgToPdfSvg = (children: React.ReactElement, chartStyle?: Style) => { * */ const ReactPDFChart = ({ children, chartStyle, debug, style }: PropsType) => { - let component = webSvgToPdfSvg(children, chartStyle); + let component = convertHTMLToPDF(children, chartStyle); // This should never happen, but it's here for type safety if (!component || typeof component === 'string') return <>{component};