{"id":18355140,"url":"https://github.com/flowup/ngx-hackable-markdown","last_synced_at":"2025-08-24T22:13:48.172Z","repository":{"id":46561438,"uuid":"153671241","full_name":"flowup/ngx-hackable-markdown","owner":"flowup","description":" A customizable Markdown renderer wrapped in an Angular component","archived":false,"fork":false,"pushed_at":"2021-10-05T19:56:44.000Z","size":803,"stargazers_count":4,"open_issues_count":15,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-09T04:44:38.437Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/flowup.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":"2018-10-18T18:43:09.000Z","updated_at":"2020-07-24T21:49:48.000Z","dependencies_parsed_at":"2022-09-22T02:00:24.048Z","dependency_job_id":null,"html_url":"https://github.com/flowup/ngx-hackable-markdown","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/flowup/ngx-hackable-markdown","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowup%2Fngx-hackable-markdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowup%2Fngx-hackable-markdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowup%2Fngx-hackable-markdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowup%2Fngx-hackable-markdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flowup","download_url":"https://codeload.github.com/flowup/ngx-hackable-markdown/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowup%2Fngx-hackable-markdown/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267966469,"owners_count":24173550,"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","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2024-11-05T22:06:05.446Z","updated_at":"2025-07-31T00:33:35.047Z","avatar_url":"https://github.com/flowup.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ngx-hackable-markdown\n\nA **customizable** Markdown renderer wrapped in an Angular component.\n\n- **Template-driven** -- accepts `ng-template`s overriding how HTML tags and entities are rendered.\n- **Angular-Universal-friendly** -- works with server-side rendering.\n\n**This is a 0.x.x version. Breaking API changes might come and bugs might occur!**\n\n## Installation\n\n```\nnpm install --save ngx-hackable-markdown\n```\n\n## Example\n\n### my.module.ts\n```typescript\n@NgModule({\n  imports: [\n    CommonModule,\n    HackableMarkdownModule, // DON'T FORGET TO IMPORT\n  ],\n  declarations: [MyComponent],\n  exports: [MyComponent]\n})\nexport class MyModule { }\n```\n\n### my.component.html\n```html\n\u003cdiv [ngxHackableMarkdown]=\"markdownSource\"\u003e\n\n  \u003c!--styled spans surrouned by guillemets instead of strongs--\u003e\n  \u003cng-template ngxHackableTag=\"strong\" let-children=\"children\"\u003e\n    \u003cspan style=\"font-weight: bold\"\u003e\n      \u003cng-container\u003e\u0026raquo;\u003c/ng-container\u003e\n      \u003cng-container [ngxHackableChildren]=\"children\"\u003e\u003c/ng-container\u003e\n      \u003cng-container\u003e\u0026laquo;\u003c/ng-container\u003e\n    \u003c/span\u003e\n  \u003c/ng-template\u003e\n\n  \u003c!--blue triple bullets instead of ellipses--\u003e\n  \u003cng-template ngxHackableTag=\"hellip\"\u003e\n    \u003cspan style=\"color: blue\"\u003e\u0026bull; \u0026bull; \u0026bull;\u003c/span\u003e\n  \u003c/ng-template\u003e\n\n  \u003c!--heading IDs based on their text contents--\u003e\n  \u003cng-template ngxHackableTag=\"h1\" let-content=\"content\" let-children=\"children\"\u003e\n    \u003ch1 [id]=\"content | myTransformPipe\"\u003e\n      \u003cng-container [ngxHackableChildren]=\"children\"\u003e\u003c/ng-container\u003e\n    \u003c/h1\u003e\n  \u003c/ng-template\u003e\n\n  \u003c!--custom buttons instead of links--\u003e\n  \u003cng-template ngxHackableTag=\"a\" let-metadata=\"metadata\" let-children=\"children\"\u003e\n    \u003cbutton (click)=\"myRedirectHandler(metadata[0])\"\n            [title]=\"metadata[1]\"\u003e\n      \u003cng-container [ngxHackableChildren]=\"children\"\u003e\u003c/ng-container\u003e\n    \u003c/button\u003e\n  \u003c/ng-template\u003e\n\n\u003c/div\u003e\n```\n\n## Templating capabilities\n\nThe `ngxHackableTag` directive should **always** adorn an `ng-template` and accepts the following arguments:\n\n- HTML tags: `a`, `blockquote`, `code`, `del`, `em`, `h1`, `h2`, `h3`, `h4`, `h5`, `h6`, `hr`, `img`, `li`, `ol`, `p`, `pre`, `strong`, `ul`.\n- HTML entities: `ndash` (rendered from `--`), `mdash` (rendered from `---`), `hellip` (rendered from `...`).\n\nThe view-nesting `[ngxHackableChildren]` directive adorning an `ng-container` can (and usually **should**) be used inside templates for all HTML tags except `hr` and `img`.\n\nThe following view context properties can be used in templates (see the example above):\n\n- `content` -- the object's recursive text content.\n- `metadata` -- an array of metadata like URL, title, etc. Exposed in `a` and `img` templates. E.g. `[foo](bar \"baz plox\")` yields `['bar', 'baz plox']`\n- `children` -- a reference to the given node's children that should be passed to the `[ngxHackableChildren]` directive.\n\nSee [this cheat-sheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) (or inspect rendered DOM) in case of uncertainty about which Markdown syntax maps to a given tag.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflowup%2Fngx-hackable-markdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflowup%2Fngx-hackable-markdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflowup%2Fngx-hackable-markdown/lists"}