html2md  v1.6.0
Simple and fast HTML to Markdown converter
Loading...
Searching...
No Matches
html2md::Options Struct Reference

Options for the conversion from HTML to Markdown. More...

#include <html2md.h>

Public Member Functions

bool operator== (html2md::Options o) const
 

Public Attributes

bool splitLines = true
 Add new line when a certain number of characters is reached.
 
int softBreak = 80
 softBreak Wrap after ... characters when the next space is reached and as long as it's not in a list, table, image or anchor (link).
 
int hardBreak = 100
 hardBreak Force a break after ... characters in a line
 
char unorderedList = '-'
 The char used for unordered lists.
 
char orderedList = '.'
 The char used after the number of the item.
 
bool includeTitle = true
 Whether title is added as h1 heading at the very beginning of the markdown.
 
bool formatTable = true
 Whetever to format Markdown Tables.
 

Detailed Description

Options for the conversion from HTML to Markdown.

Warning
Make sure to pass valid options; otherwise, the output will be invalid!

Example from tests/main.cpp:

auto *options = new html2md::Options();
options->splitLines = false;
html2md::Converter c(html, options);
auto md = c.convert();
Class for converting HTML to Markdown.
Definition html2md.h:159
Options for the conversion from HTML to Markdown.
Definition html2md.h:38

Definition at line 38 of file html2md.h.

Member Function Documentation

◆ operator==()

bool html2md::Options::operator== ( html2md::Options o) const
inline

Definition at line 109 of file html2md.h.

Member Data Documentation

◆ formatTable

bool html2md::Options::formatTable = true

Whetever to format Markdown Tables.

Whetever to format Markdown Tables. Default is true.

Definition at line 107 of file html2md.h.

◆ hardBreak

int html2md::Options::hardBreak = 100

hardBreak Force a break after ... characters in a line

Definition at line 56 of file html2md.h.

◆ includeTitle

bool html2md::Options::includeTitle = true

Whether title is added as h1 heading at the very beginning of the markdown.

Whether title is added as h1 heading at the very beginning of the markdown. Default is true.

Definition at line 99 of file html2md.h.

◆ orderedList

char html2md::Options::orderedList = '.'

The char used after the number of the item.

Valid:

  • .
  • )

Example:

1. Hello
2) World!

Definition at line 90 of file html2md.h.

◆ softBreak

int html2md::Options::softBreak = 80

softBreak Wrap after ... characters when the next space is reached and as long as it's not in a list, table, image or anchor (link).

Definition at line 51 of file html2md.h.

◆ splitLines

bool html2md::Options::splitLines = true

Add new line when a certain number of characters is reached.

See also
softBreak
hardBreak

Definition at line 45 of file html2md.h.

◆ unorderedList

char html2md::Options::unorderedList = '-'

The char used for unordered lists.

Valid:

  • -
  • +
  • *

Example:

- List
+ Also a list
* And this to

Definition at line 74 of file html2md.h.


The documentation for this struct was generated from the following file: