mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-26 02:05:31 +00:00
chore(app): match the vendored Markdown web block renderer source to its build
The package patch changed lib/module/web/renderers/BlockRenderers.js (the renderers.codeBlock override and the zoom-in cursor on images) but not src/web/renderers/BlockRenderers.tsx. The app runs lib, so behavior does not change. Port both changes into src so src stays the source of lib.
This commit is contained in:
@@ -90,12 +90,28 @@ function AdmonitionRenderer({
|
||||
}
|
||||
|
||||
function CodeBlockRenderer({
|
||||
capabilities,
|
||||
node,
|
||||
styles,
|
||||
renderChildren,
|
||||
callbacks,
|
||||
}: RendererProps) {
|
||||
const language = node.attributes?.language;
|
||||
const CustomCodeBlock = capabilities.renderers?.codeBlock;
|
||||
if (CustomCodeBlock) {
|
||||
// The custom renderer owns the block's look; the library keeps its spacing,
|
||||
// including the zeroed trailing margin of the last block.
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
marginTop: styles.codeBlock.marginTop,
|
||||
marginBottom: styles.codeBlock.marginBottom,
|
||||
}}
|
||||
>
|
||||
<CustomCodeBlock code={extractNodeText(node)} language={language ?? ''} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
const label = language ? `Code block: ${language}` : 'Code block';
|
||||
|
||||
if (callbacks.onCodeBlockPress == null) {
|
||||
@@ -196,7 +212,7 @@ function ImageRenderer({ node, styles, parentType, callbacks }: RendererProps) {
|
||||
src={url}
|
||||
alt={alt}
|
||||
title={title}
|
||||
style={imgStyle}
|
||||
style={{ ...imgStyle, cursor: 'zoom-in' }}
|
||||
role="button"
|
||||
tabIndex={0}
|
||||
aria-label={alt}
|
||||
|
||||
Reference in New Issue
Block a user