-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathparserconfig.h
97 lines (81 loc) · 2.32 KB
/
parserconfig.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/*
* This project is licensed under the MIT license. For more information see the
* LICENSE file.
*/
#pragma once
#include <stdint.h>
// -----------------------------------------------------------------------------
namespace maddy {
// -----------------------------------------------------------------------------
namespace types {
// clang-format off
/**
* PARSER_TYPE
*
* Bitwise flags to turn on/off each parser
*/
enum PARSER_TYPE : uint32_t
{
NONE = 0,
BREAKLINE_PARSER = 0b1,
CHECKLIST_PARSER = 0b10,
CODE_BLOCK_PARSER = 0b100,
EMPHASIZED_PARSER = 0b1000,
HEADLINE_PARSER = 0b10000,
HORIZONTAL_LINE_PARSER = 0b100000,
HTML_PARSER = 0b1000000,
IMAGE_PARSER = 0b10000000,
INLINE_CODE_PARSER = 0b100000000,
ITALIC_PARSER = 0b1000000000,
LINK_PARSER = 0b10000000000,
ORDERED_LIST_PARSER = 0b100000000000,
PARAGRAPH_PARSER = 0b1000000000000,
QUOTE_PARSER = 0b10000000000000,
STRIKETHROUGH_PARSER = 0b100000000000000,
STRONG_PARSER = 0b1000000000000000,
TABLE_PARSER = 0b10000000000000000,
UNORDERED_LIST_PARSER = 0b100000000000000000,
LATEX_BLOCK_PARSER = 0b1000000000000000000,
DEFAULT = 0b0111111111110111111,
ALL = 0b1111111111111111111,
};
// clang-format on
} // namespace types
/**
* ParserConfig
*
* @class
*/
struct ParserConfig
{
/**
* @deprecated will be removed in 1.4.0 latest
*
* this flag = false == `enabledParsers &= ~maddy::types::EMPHASIZED_PARSER`
*/
bool isEmphasizedParserEnabled;
/**
* @deprecated will be removed in 1.4.0 latest
*
* this flag = false == `enabledParsers |= maddy::types::HTML_PARSER`
*/
bool isHTMLWrappedInParagraph;
/**
* en-/disable headline inline-parsing
*
* default: enabled
*/
bool isHeadlineInlineParsingEnabled;
/**
* enabled parsers bitfield
*/
uint32_t enabledParsers;
ParserConfig()
: isEmphasizedParserEnabled(true)
, isHTMLWrappedInParagraph(true)
, isHeadlineInlineParsingEnabled(true)
, enabledParsers(maddy::types::DEFAULT)
{}
}; // class ParserConfig
// -----------------------------------------------------------------------------
} // namespace maddy