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:
Mohamed Boudra
2026-11-22 08:22:50 +01:00
parent 43ec56d07f
commit b5913fd2a2
@@ -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}