https://github.com/baynezy/html2markdown
A library for converting HTML to markdown syntax in C#
https://github.com/baynezy/html2markdown
c-sharp html html2markdown markdown nuget
Last synced: 18 days ago
JSON representation
A library for converting HTML to markdown syntax in C#
- Host: GitHub
- URL: https://github.com/baynezy/html2markdown
- Owner: baynezy
- License: apache-2.0
- Created: 2013-07-03T06:06:50.000Z (almost 12 years ago)
- Default Branch: develop
- Last Pushed: 2025-04-11T01:12:17.000Z (19 days ago)
- Last Synced: 2025-04-12T00:12:47.971Z (18 days ago)
- Topics: c-sharp, html, html2markdown, markdown, nuget
- Language: C#
- Size: 4.58 MB
- Stars: 293
- Watchers: 9
- Forks: 55
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# HTML2Markdown
Converts HTML to [Markdown](http://daringfireball.net/projects/markdown/syntax).
---

## Build Status
| Branch | Status |
|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `master` | [](https://github.com/baynezy/Html2Markdown/actions/workflows/branch-master.yml) |
| `develop` | [](https://github.com/baynezy/Html2Markdown/actions/workflows/branch-develop.yml) |[](https://sonarcloud.io/summary/new_code?id=baynezy_Html2Markdown)
[](https://sonarcloud.io/summary/new_code?id=baynezy_Html2Markdown)## Support
This project will currently convert the following HTML tags:-
- ``
- ``
- ``
- ``
- ``
- `
`
- ``
- ``
- ``
- ``
- ``
- ``
- ``
- ``
- ``
- `
`
- ``
- ``
- ``
- ``
## Installing via NuGet
[](http://badge.fury.io/nu/Html2Markdown)
```pwsh
Install-Package Html2Markdown
```## Usage
### Strings
```csharp
var html = "Something to convert";
var converter = new Converter();
var markdown = converter.Convert(html);
```### Files
```csharp
var path = "file.html";
var converter = new Converter();
var markdown = converter.ConvertFile(path);
```### Documentation
[Library Documentation](https://baynezy.github.io/Html2Markdown/)
## Customise
### Create new `IScheme` implementation
Create your own implementation of `IScheme` and construct `Converter` with that.
```csharp
var html = "Something to convert";
var converter = new Converter(customConversionScheme);
var markdown = converter.Convert(html);
```## Try it
This library is showcased at [http://html2markdown.bayn.es](http://html2markdown.bayn.es).
## Contributing
[For those interested in contributing then please read the guidelines](CONTRIBUTING.md)
## License
This project is licensed under [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0).