{"id":47948544,"url":"https://github.com/reqable/re-markdown","last_synced_at":"2026-04-08T12:01:12.341Z","repository":{"id":348891647,"uuid":"1198659192","full_name":"reqable/re-markdown","owner":"reqable","description":"A lightweight markdown widget for flutter.","archived":false,"fork":false,"pushed_at":"2026-04-03T09:38:08.000Z","size":301,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-04T08:54:10.337Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dart","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/reqable.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-01T16:24:28.000Z","updated_at":"2026-04-03T09:38:12.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/reqable/re-markdown","commit_stats":null,"previous_names":["reqable/re-markdown"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/reqable/re-markdown","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reqable%2Fre-markdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reqable%2Fre-markdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reqable%2Fre-markdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reqable%2Fre-markdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reqable","download_url":"https://codeload.github.com/reqable/re-markdown/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reqable%2Fre-markdown/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31430011,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T08:13:15.228Z","status":"ssl_error","status_checked_at":"2026-04-05T08:13:11.839Z","response_time":75,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2026-04-04T08:54:08.048Z","updated_at":"2026-04-05T09:01:15.628Z","avatar_url":"https://github.com/reqable.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Re-Markdown\n\n[![latest version](https://img.shields.io/pub/v/re_markdown.svg?color=blue)](https://pub.dev/packages/re_markdown)\n\n[中文版本](./README_CN.md)\n\n`Re-Markdown` is a lightweight Flutter Markdown preview widget and a submodule of the [Reqable](https://reqable.com) project. `Re-Markdown` uses [re-highlight](https://github.com/reqable/re-highlight) as its code highlighting engine, supports hundreds of programming languages and color themes, and provides extensibility for custom code views, image views, and link actions. It also supports streaming rendering for AI-generated content.\n\n**⚠️ Note: Table of contents (TOC) features are not supported.**\n\n![](./arts/screenshot_01.png)\n\n## Getting Started\n\nAdd the dependency to `pubspec.yaml`.\n\n```yaml\ndependencies:\n\tre_markdown: ^0.0.1\n```\n\nRender your Markdown content:\n\n```dart\nMarkdown(\n\tdata: \"Your markdown content here\",\n)\n```\n\n## Customize Base Styles\n\nYou can use `StyleSheet` to configure styles for each Markdown tag and block in your Markdown view.\n\n```dart\nStyleSheet(\n\ta: const TextStyle(color: Colors.blue),\n\tp: theme.textTheme.bodyMedium,\n\tpPadding: EdgeInsets.zero,\n\tcode: theme.textTheme.bodyMedium!.copyWith(\n\t\tbackgroundColor: theme.cardTheme.color ?? theme.cardColor,\n\t\tfontFamily: 'monospace',\n\t\tfontSize: theme.textTheme.bodyMedium!.fontSize! * 0.85,\n\t),\n\th1: theme.textTheme.headlineSmall,\n\th1Padding: EdgeInsets.zero,\n\th2: theme.textTheme.titleLarge,\n\th2Padding: EdgeInsets.zero,\n\th3: theme.textTheme.titleMedium,\n\th3Padding: EdgeInsets.zero,\n\th4: theme.textTheme.bodyLarge,\n\th4Padding: EdgeInsets.zero,\n\th5: theme.textTheme.bodyLarge,\n\th5Padding: EdgeInsets.zero,\n\th6: theme.textTheme.bodyLarge,\n\th6Padding: EdgeInsets.zero,\n\tem: const TextStyle(fontStyle: FontStyle.italic),\n\tstrong: const TextStyle(fontWeight: FontWeight.bold),\n\tdel: const TextStyle(decoration: TextDecoration.lineThrough),\n\tblockquote: theme.textTheme.bodyMedium,\n\timg: theme.textTheme.bodyMedium,\n\tcheckbox: theme.textTheme.bodyMedium!.copyWith(\n\t\tcolor: theme.primaryColor,\n\t),\n\tblockSpacing: 8.0,\n\tlistIndent: 24.0,\n\tlistBullet: theme.textTheme.bodyMedium,\n\tlistBulletPadding: const EdgeInsets.only(right: 4),\n\ttableHead: const TextStyle(fontWeight: FontWeight.w600),\n\ttableBody: theme.textTheme.bodyMedium,\n\ttableHeadAlign: TextAlign.center,\n\ttableBorder: TableBorder.all(\n\t\tcolor: theme.dividerColor,\n\t),\n\ttableColumnWidth: const FlexColumnWidth(),\n\ttableCellsPadding: const EdgeInsets.fromLTRB(16, 8, 16, 8),\n\ttableCellsDecoration: const BoxDecoration(),\n\tblockquotePadding: const EdgeInsets.all(8.0),\n\tblockquoteDecoration: BoxDecoration(\n\t\tcolor: Colors.blue.shade100,\n\t\tborderRadius: BorderRadius.circular(2.0),\n\t),\n\tcodeblockPadding: const EdgeInsets.all(8.0),\n\tcodeblockDecoration: BoxDecoration(\n\t\tcolor: theme.cardTheme.color ?? theme.cardColor,\n\t\tborderRadius: BorderRadius.circular(2.0),\n\t),\n\tcodePadding: EdgeInsets.zero,\n\tcodeDecoration: BoxDecoration(\n\t\tcolor: theme.cardTheme.color ?? theme.cardColor,\n\t\tborderRadius: BorderRadius.circular(2.0),\n\t),\n\thorizontalRuleDecoration: BoxDecoration(\n\t\tborder: Border(\n\t\t\ttop: BorderSide(\n\t\t\t\twidth: 5.0,\n\t\t\t\tcolor: theme.dividerColor,\n\t\t\t),\n\t\t),\n\t),\n);\n```\n\n## Customize Code Block Styles\n\nYou can use `CodeBlockWidgetBuilder` to customize code block rendering. A default implementation, `DefaultCodeBlockWidgetBuilder`, is provided. You can configure syntax highlighting styles through its parameters, or subclass it and override `build` to add more features, such as wrap and copy buttons.\n\n```dart\nclass _CodeBlockWidgetBuilder extends DefaultCodeBlockWidgetBuilder {\n\n\t_CodeBlockWidgetBuilder({\n\t\trequired super.wordWrap,\n\t\trequired super.theme,\n\t});\n\n\t@override\n\tWidget build(BuildContext context, CodeBlockNodeData data, StyleSheet styleSheet) {\n\t\treturn Stack(\n\t\t\tchildren: [\n\t\t\t\tsuper.build(context, data, styleSheet),\n\t\t\t\tPositioned(\n\t\t\t\t\tright: 5,\n\t\t\t\t\ttop: 5,\n\t\t\t\t\tchild: Row(\n\t\t\t\t\t\tchildren: [\n\t\t\t\t\t\t\t// TODO: add icon buttons\n\t\t\t\t\t\t],\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t],\n\t\t);\n\t}\n\n}\n```\n\n## Customize Image Styles\n\nYou can use `ImageWidgetBuilder` to customize image rendering, including loading logic and error states. A default implementation, `DefaultImageWidgetBuilder`, is provided and supports custom image load-failure views. If you need full control, you can implement the `ImageWidgetBuilder` interface yourself.\n\n```dart\nclass CustomImageWidgetBuilder implements ImageWidgetBuilder {\n\n\t@override\n\tWidget build(BuildContext context, ImageNodeData data, StyleSheet styleSheet) {\n\t\t// TODO: Add support for image loading and error handling.\n\t}\n\n}\n```\n\n## Customize Tap Actions\n\nBy default, links are opened using `url_launcher`. You can customize link tap behavior by implementing the `LinkActionBuilder` interface.\n\n```dart\nclass _LinkActionBuilder implements LinkActionBuilder {\n\n\t@override\n\tvoid onTap(BuildContext context, Uri uri) {\n\t\t// TODO: handle your tap event.\n\t}\n\n}\n```\n\n## Content Selection\n\n`Re-Markdown` supports full content selection. Just wrap it with `SelectionArea` in the parent layout.\n\n```dart\nSelectionArea(\n\tchild: Markdown(\n\t\tdata: \"Your markdown content here\",\n\t)\n)\n```\n\n## Supported Markdown Tags\n\n- blockquote\n- ul\n- ol\n- li\n- table\n- thead\n- tbody\n- tr\n- th\n- td\n- hr\n- pre\n- h1\n- h2\n- h3\n- h4\n- h5\n- h6\n- a\n- p\n- code\n- em\n- del\n- br\n- strong\n- img\n- input\n- comment\n\n## License\n\nMIT License\n\n## Acknowledgements\n\nDuring development, we used or referenced the following projects. We sincerely appreciate their work.\n\n- [markdown](https://pub.dev/packages/markdown)\n- [markdown_widget](https://pub.dev/packages/markdown_widget)\n\n## Sponsor\n\nIf this project is helpful to you, you are welcome to support us by purchasing a [Reqable](https://reqable.com/pricing) membership.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freqable%2Fre-markdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freqable%2Fre-markdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freqable%2Fre-markdown/lists"}