{"id":13994794,"url":"https://github.com/soffes/unmarkdown","last_synced_at":"2025-04-09T18:19:24.110Z","repository":{"id":12528188,"uuid":"15198098","full_name":"soffes/unmarkdown","owner":"soffes","description":"Convert HTML to Markdown. Sometimes you just need to go the other way.","archived":false,"fork":false,"pushed_at":"2020-02-10T17:11:22.000Z","size":17,"stargazers_count":133,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-09T18:19:19.682Z","etag":null,"topics":["html","markdown","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/soffes.png","metadata":{"files":{"readme":"Readme.markdown","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":"2013-12-15T05:02:09.000Z","updated_at":"2024-10-26T11:10:41.000Z","dependencies_parsed_at":"2022-07-08T00:56:09.682Z","dependency_job_id":null,"html_url":"https://github.com/soffes/unmarkdown","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/soffes%2Funmarkdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soffes%2Funmarkdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soffes%2Funmarkdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soffes%2Funmarkdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/soffes","download_url":"https://codeload.github.com/soffes/unmarkdown/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248085325,"owners_count":21045139,"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":["html","markdown","ruby"],"created_at":"2024-08-09T14:03:06.473Z","updated_at":"2025-04-09T18:19:24.092Z","avatar_url":"https://github.com/soffes.png","language":"Ruby","readme":"# Unmarkdown\n\nConvert HTML to Markdown with Ruby.\n\nThere are several libraries that solve this, but Unmarkdown is simple. It's only [150 lines](lib/unmarkdown/parser.rb) and handles everything I threw at it with no problem. The other libraries I tried either didn't do recursion correctly or were missing some Markdown extensions I needed. Both were hard to change, so I just whipped this up in a few hours.\n\nEnjoy!\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n``` ruby\ngem 'unmarkdown'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install unmarkdown\n\n## Usage\n\n``` ruby\nmarkdown = Unmarkdown.parse('Some \u003cstrong\u003eHTML\u003c/strong\u003e')\n#=\u003e Some **HTML**\n\nmarkdown = Unmarkdown.parse('My website is http://soff.es', autolink: true)\n#=\u003e My website is \u003ca href=\"http://soff.es\"\u003ehttp://soff.es\u003c/a\u003e\n```\n\n## Support\n\n### Supported tags\n\n* h1-h6\n* blockquote\n* ul, ol, li\n* pre\n* hr\n* a\n* em, i\n* strong, b\n* u\n* mark\n* code\n* img\n\nFor tags that aren't supported, their content will be added to the output. Basically it treats everything like a `\u003cp\u003e`.\n\n### Options\n\nAll of the options default to `false`. If you'd like to turn additional things on, pass a hash with symbols as the second argument to `Unmarkdown.parse` (see example above).\n\n* `fenced_code_blocks` — Uses three backticks before and after instead of four spaces before each line\n* `allow_scripts` — By default, script tags are removed. If you set this option to `true` their original HTML will be included in the output\n* `underline_headers` — By default hashes are added before headers. If you turn this option on, it will use equal signs for h1's or hypens for h2's and the rest will remain hashes.\n\n## Contributing\n\n1. Fork it ( http://github.com/soffes/unmarkdown/fork )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","funding_links":[],"categories":["Ruby","Convert to Markdown Tools"],"sub_categories":["Hypertext Markup Language (HTML) to Markdown"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoffes%2Funmarkdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoffes%2Funmarkdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoffes%2Funmarkdown/lists"}