Releases: mientjan/react-native-markdown-renderer
Releases · mientjan/react-native-markdown-renderer
v4.1.0
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
v4.0.0
Breaking Changes
- Minimum React 18.0.0 (was 16.2.0)
- Minimum React Native 0.73.0 (was 0.50.4)
react-native-fit-imageremoved - The defaultimagerender rule now uses React Native's built-in<Image>component. Users who need auto-sizing image behavior should provide a customimagerender rule.prop-typesremoved - Runtime prop validation is no longer performed. Use TypeScript for type checking.- Class component replaced with function component -
<Markdown>is now a function component using hooks. Code relying on class instance methods or refs will break. markdown-itupgraded from ^8 to ^14 - Custom markdown-it plugins should verify compatibility.- Package entry points changed -
mainnow points tolib/commonjs/index.js,moduletolib/module/index.js,typestolib/typescript/index.d.ts.
New Features
- Full TypeScript source with auto-generated type declarations
- Exported types:
ASTNode,RenderFunction,RenderRules,MarkdownStyles,MarkdownProps - ESM module output via react-native-builder-bob
- Proper memoization using
useMemohooks for better rendering performance
Improvements
- All source converted from JavaScript to TypeScript
- Deprecated
componentWillMountandcomponentWillReceivePropsreplaced with hooks - Broken
PropTypesimport fromreactremoved in AstRenderer - Unused
ReactandViewimports removed from parser - ESLint + Prettier configured
- Jest test suite with 99 tests across 17 suites
- Integration snapshot tests for comprehensive markdown rendering
Removed
react-native-fit-imagedependencyprop-typesdependencychokidarandfs-extradev dependenciesbin/build scripts (replaced by react-native-builder-bob)export.jsondebug artifact- Hand-written
index.d.ts(replaced by auto-generated types) .npmignore(replaced byfilesfield in package.json)
v3.2.8
v3.2.7
v3.2.6
- v3.2.6 fixed issue where stringToTokens is not being exported correctly Mient-jan Stelling 6/4/18, 15:53
- fixed issue where stringToTokens is not being exported correctly Mient-jan Stelling 6/4/18, 15:40
- beta 3.2.5 removing of console.logs Mient-jan Stelling 6/4/18, 15:25
- beta 3.2.4 fixed issue where images where only shown as copy. Mient-jan Stelling 6/4/18, 15:23
- beta 3.2.4 fixed issue where images where only shown as copy. Mient-jan Stelling 6/4/18, 15:23
- beta 3.2.3 Mient-jan Stelling 6/4/18, 15:11
- cleaup of code, removing on used code #39 Mient-jan Stelling 6/4/18, 15:06
- removing all unused functions. #39 Mient-jan Stelling 6/4/18, 14:56
- fixed issue with images not linking. #39 Mient-jan Stelling 6/4/18, 14:53
- adding styles to root style to markdown renderer #50 Mient-jan Stelling 6/4/18, 12:49
- fixed issue Crash on hardbreak inside strong #51 Mient-jan Stelling 6/4/18, 12:36
- fixed issue with bold copy #39 Mient-jan Stelling 6/4/18, 12:35
- remove text and inline elements and rely on block property from token. #39 Mient-jan Stelling 6/4/18, 11:54
- reformatting main class Mient-jan Stelling 6/4/18, 11:27
v3.2.2
v3.2.1
v3.2.0
- adding info and meta as sourceInfo and sourceMeta #38 #27 Mient-jan Stelling 5/8/18, 14:45
- adding meta to the new node from markdown-it meta #38 Mient-jan Stelling 5/8/18, 14:37
- fixed issue #24 Mient-jan Stelling 5/3/18, 12:08
- adding working example app Mient-jan Stelling 4/12/18, 20:13
- #33 removing expo adding scratch example app Mient-jan Stelling 4/12/18, 19:29
- fix issue where link url in openUrl function is not defined when clicking on that item will crash the app. Mient-jan Stelling 3/28/18, 19:37
- fix PluginContainer.toArray doomsower 4/14/18, 20:34
- Fix nodes and components types doomsower 4/14/18, 14:02
- Fix typo doomsower 4/14/18, 13:51
- Add typescript definitions doomsower 4/14/18, 13:49
- Add styles property for easier overriding of styles doomsower 7/23/17, 15:42
- Merge pull request #36 from Leeds-eBooks/patch-1 Mient-jan Stelling* 5/3/18, 12:12
- Use bullet character for ul instead of middle-dot Ben Styles* 4/21/18, 18:45
- adding prettierrc for prettier code formatting Mient-jan Stelling 3/28/18, 17:49
- Merge pull request #30 from redbrick-health/additional-adds Mient-jan Stelling* 3/28/18, 17:40