New Features
onLinkPressprop — custom link press handler, falls back toLinking.openURL()mergeStyleprop (defaulttrue) — deep-merge custom styles with defaults per key instead of replacing entire style objectsdebugPrintTreeprop — log the AST tree structure to console for debuggingmaxTopLevelChildren+topLevelMaxExceededItemprops — preview mode to limit rendered top-level childrenallowedImageHandlers+defaultImageHandlerprops — validate image URL schemes before rendering- Image accessibility —
accessibilityLabelandaccessibleset from image alt text
Bug Fixes
- Hardbreak renders as
<Text>{'\n'}</Text>instead of<View>— fixes crash on Android when hardbreak is inside a Text node - Code block and fence rules trim trailing newline added by markdown-it parser
- Ordered list respects the
startattribute (e.g.57. foonow renders as 57 instead of 1)
Internal
RenderFunctiontype extended with...args: unknown[]rest parameter for backward-compatible extra arguments- New
AstRendererOptionsinterface for renderer configuration AstRendererconstructor accepts optional thirdoptionsargument- 41 new unit tests (140 total across 17 suites)
Full Changelog: v4.0.0...v4.1.0