mirror of
https://github.com/enricoros/big-AGI.git
synced 2026-05-10 21:50:14 -07:00
RenderCode HTML: rename
This commit is contained in:
@@ -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'
|
||||
|
||||
+1
-1
@@ -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(() => {
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user