{"id":20597134,"url":"https://github.com/tradle/rn-markdown","last_synced_at":"2025-10-27T01:15:17.522Z","repository":{"id":44993449,"uuid":"93706410","full_name":"tradle/rn-markdown","owner":"tradle","description":"basic markdown renderer for react-native using the great https://github.com/chjj/marked parser","archived":false,"fork":false,"pushed_at":"2023-01-11T02:02:16.000Z","size":106,"stargazers_count":22,"open_issues_count":8,"forks_count":9,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-14T23:52:52.001Z","etag":null,"topics":["component","markdown","marked","react","react-component","react-native"],"latest_commit_sha":null,"homepage":"https://tradle.github.io/rn-markdown-playground/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tradle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-08T04:10:35.000Z","updated_at":"2023-05-21T07:53:05.000Z","dependencies_parsed_at":"2023-02-08T22:16:33.547Z","dependency_job_id":null,"html_url":"https://github.com/tradle/rn-markdown","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tradle%2Frn-markdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tradle%2Frn-markdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tradle%2Frn-markdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tradle%2Frn-markdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tradle","download_url":"https://codeload.github.com/tradle/rn-markdown/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248981260,"owners_count":21193144,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["component","markdown","marked","react","react-component","react-native"],"created_at":"2024-11-16T08:20:26.797Z","updated_at":"2025-10-27T01:15:12.484Z","avatar_url":"https://github.com/tradle.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rn-markdown\n\nMarkdown rendering component, using the parser from [marked](https://github.com/chjj/marked).\n\n[play](https://tradle.github.io/rn-markdown-playground/) with the [react-native-web](https://github.com/necolas/react-native-web) version\n\n## Install\n\n```sh\nnpm install --save rn-markdown\n# or\nyarn add rn-markdown\n```\n\n## Usage\n\nThe example below, and the component styles were adapted from [react-native-simple-markdown](https://github.com/CharlesMangwa/react-native-simple-markdown).\n\n```js\nimport React, { Component } from 'react'\nimport {\n  AppRegistry,\n  StyleSheet,\n  Text,\n  View,\n  Alert,\n  TouchableHighlight\n} from 'react-native'\n\nimport createMarkdownRenderer from 'rn-markdown'\n\n// pass in `marked` opts, e.g. gfm: true for Github Flavored Markdown\nconst Markdown = createMarkdownRenderer({ gfm: false })\n\n// define a custom renderer for links\nMarkdown.renderer.link = props =\u003e {\n  const { markdown, passThroughProps } = props\n  const { href } = markdown\n  return (\n    \u003cTouchableHighlight onPress={() =\u003e Alert.alert('check out this hot href', href)}\u003e\n      \u003cView\u003e\n        {props.children}\n      \u003c/View\u003e\n    \u003c/TouchableHighlight\u003e\n  )\n}\n\n// example partially from react-native-simple-markdown\nexport default class MarkdownExample extends Component {\n  render() {\n    const text =\n`\nYou can **emphasize**\n\nYou can even [**link your website**](http://carlito.ninja) or if you prefer: [email somebody](mailto:email@somebody.com)\n\nSpice it up with some GIFs 💃:\n\n![Some GIF](https://media.giphy.com/media/dkGhBWE3SyzXW/giphy.gif)\n\nAnd even add a cool video 😎!\n\n[![A cool video from YT](https://img.youtube.com/vi/dQw4w9WgXcQ/0.jpg)](http://www.youtube.com/watch?v=dQw4w9WgXcQ)\n\n[![Another one from Vimeo](https://i.vimeocdn.com/video/399486266_640.jpg)](https://vimeo.com/57580368)\n\n# heading 1\n\ncontent 1\n\n## heading 2\n\n### heading 3\n\n#### heading 4\n\nuh oh...numbered list coming up\n\n1. a\n1. b\n  - with an unnumbered list inside\n  - blah\n    - blah blah\n\nmore frakking lists\n\n- blah\n- blah1\n- blah2\n  - blah2.1\n  - blah2.2\n    - blah2.2.1\n    - blah2.2.2\n`\n\n    return (\n      \u003cMarkdown contentContainerStyle={styles.container} markdownStyles={markdownStyles} passThroughProps={{ passMeThrough: 'to the child renderer components' }}\u003e\n        {text}\n      \u003c/Markdown\u003e\n    )\n  }\n}\n\nconst markdownStyles = {\n  container: {\n    paddingLeft: 10\n  },\n  heading1: {\n    fontSize: 24,\n    color: 'purple',\n  },\n  link: {\n    color: 'pink',\n  },\n  mail_to: {\n    color: 'orange',\n  },\n  text: {\n    color: '#555555',\n  },\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    justifyContent: 'center',\n    alignItems: 'center',\n    backgroundColor: '#F5FCFF',\n  }\n})\n\nAppRegistry.registerComponent('MarkdownExample', () =\u003e MarkdownExample)\n```\n\n## Contributing\n\nThis is a work in progress and contributions are welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftradle%2Frn-markdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftradle%2Frn-markdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftradle%2Frn-markdown/lists"}