RenderCode HTML: rename

This commit is contained in:
Enrico Ros
2024-08-02 16:48:20 -07:00
parent ae842984f2
commit c3d54defb7
3 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -20,7 +20,7 @@ import type { CodeBlock } from '../blocks.types';
import { ButtonCodePen, isCodePenSupported } from './ButtonCodePen';
import { ButtonJsFiddle, isJSFiddleSupported } from './ButtonJSFiddle';
import { ButtonStackBlitz, isStackBlitzSupported } from './ButtonStackBlitz';
import { RenderCodeIFrame } from './RenderCodeIFrame';
import { RenderCodeHtmlIFrame } from './RenderCodeHtmlIFrame';
import { heuristicIsBlockTextHTML } from '../html/RenderHtml';
import { patchSvgString, RenderCodeMermaid } from './RenderCodeMermaid';
@@ -229,7 +229,7 @@ function RenderCodeImpl(props: RenderCodeImplProps) {
{/* Renders HTML, or inline SVG, inline plantUML rendered, or highlighted code */}
{renderHTML
? <RenderCodeIFrame htmlCode={blockCode} />
? <RenderCodeHtmlIFrame htmlCode={blockCode} />
: renderMermaid
? <RenderCodeMermaid mermaidCode={blockCode} fitScreen={fitScreen} />
: <Box component='div'
@@ -43,7 +43,7 @@ function renderHtmlInIFrame(iframeDoc: Document, htmlString: string) {
});
}
export function RenderCodeIFrame(props: { htmlCode: string }) {
export function RenderCodeHtmlIFrame(props: { htmlCode: string }) {
const iframeRef = React.useRef<HTMLIFrameElement>(null);
React.useEffect(() => {
+2 -2
View File
@@ -9,7 +9,7 @@ import { copyToClipboard } from '~/common/util/clipboardUtils';
import type { HtmlBlock } from '../blocks.types';
import { OverlayButton, overlayButtonsSx } from '../code/RenderCode';
import { RenderCodeIFrame } from '~/modules/blocks/code/RenderCodeIFrame';
import { RenderCodeHtmlIFrame } from '~/modules/blocks/code/RenderCodeHtmlIFrame';
// this is used by the blocks parser (for full text detection) and by the Code component (for inline rendering)
@@ -48,7 +48,7 @@ export function RenderHtml(props: { htmlBlock: HtmlBlock, sx?: SxProps }) {
{/* Highlighted Code / SVG render */}
{showHTML
? <RenderCodeIFrame htmlCode={props.htmlBlock.html} />
? <RenderCodeHtmlIFrame htmlCode={props.htmlBlock.html} />
: <Box>
<Typography>
<b>CAUTION</b> - The content you are about to access is an HTML page. It is possible that an