html2md  v1.8.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.
 
bool forceLeftTrim = false
 Whether to force left trim of lines in the final Markdown output.
 
bool compressWhitespace = false
 Whether to compress whitespace (tabs, multiple spaces) into a single space.
 

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:179
Options for the conversion from HTML to Markdown.
Definition html2md.h:39

Definition at line 39 of file html2md.h.

Member Function Documentation

◆ operator==()

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

Definition at line 127 of file html2md.h.

Member Data Documentation

◆ compressWhitespace

bool html2md::Options::compressWhitespace = false

Whether to compress whitespace (tabs, multiple spaces) into a single space.

Whether to compress whitespace (tabs, multiple spaces) into a single space. Default is false.

Definition at line 125 of file html2md.h.

◆ forceLeftTrim

bool html2md::Options::forceLeftTrim = false

Whether to force left trim of lines in the final Markdown output.

Whether to force left trim of lines in the final Markdown output. Default is false.

Definition at line 116 of file html2md.h.

◆ formatTable

bool html2md::Options::formatTable = true

Whetever to format Markdown Tables.

Whetever to format Markdown Tables. Default is true.

Definition at line 108 of file html2md.h.

◆ hardBreak

int html2md::Options::hardBreak = 100

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

Definition at line 57 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 100 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 91 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 52 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 46 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 75 of file html2md.h.


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