The markdown.cpp
File Reference
Included Headers
Classes Index
struct | TableCell |
struct | Private |
struct | LinkRef |
struct | Private |
Enumerations Index
enum class | ExplicitPageResult { ... } |
enum | Alignment { ... } |
Functions Index
size_t | isNewline (std::string_view data) |
static QCString | escapeDoubleQuotes (const QCString &s) |
static QCString | escapeSpecialChars (const QCString &s) |
static Alignment | markersToAlignment (bool leftMarker, bool rightMarker) |
helper function to convert presence of left and/or right alignment markers to an alignment value More... | |
static QCString | getFilteredImageAttributes (std::string_view fmt, const QCString &attrs) |
parse the image attributes and return attributes for given format More... | |
static bool | isBlockQuote (std::string_view data, size_t indent) |
returns true if this line starts a block quote More... | |
static size_t | isLinkRef (std::string_view data, QCString &refid, QCString &link, QCString &title) |
returns end of the link ref if this is indeed a link reference. More... | |
static bool | isHRuler (std::string_view data) |
static bool | isEmptyLine (std::string_view data) |
static size_t | computeIndentExcludingListMarkers (std::string_view data) |
static size_t | isListMarker (std::string_view data) |
static bool | isEndOfList (std::string_view data) |
static bool | isFencedCodeBlock (std::string_view data, size_t refIndent, QCString &lang, size_t &start, size_t &end, size_t &offset) |
static bool | isCodeBlock (std::string_view data, size_t offset, size_t &indent) |
static size_t | findTableColumns (std::string_view data, size_t &start, size_t &end, size_t &columns) |
Finds the location of the table's contains in the string data. More... | |
static bool | isTableBlock (std::string_view data) |
Returns TRUE iff data points to the start of a table block. More... | |
static bool | hasLineBreak (std::string_view data) |
bool | skipOverFileAndLineCommands (std::string_view data, size_t indent, size_t &offset, std::string &location) |
static bool | isOtherPage (std::string_view data) |
static ExplicitPageResult | isExplicitPage (const QCString &docs) |
QCString | markdownFileNameToId (const QCString &fileName) |
processes string s and converts markdown into doxygen/html commands. More... | |
Variables Index
const char * | g_utf8_nbsp = "\xc2\xa0" |
const char * | g_doxy_nbsp = "&_doxy_nbsp;" |
const size_t | codeBlockIndent = 4 |
static const std::unordered_map< std::string, std::string > | g_quotationHeaderMap = ... |
Macro Definitions Index
#define | AUTO_TRACE(...) (void)0 |
#define | AUTO_TRACE_ADD(...) (void)0 |
#define | AUTO_TRACE_EXIT(...) (void)0 |
#define | isIdChar(c) ... |
#define | extraChar(c) ... |
#define | isOpenEmphChar(c) ... |
#define | ignoreCloseEmphChar(c, cn) ... |
#define | isLiTag(i) ... |
#define | OPC(x) if (literal_at(data,#x " ") || literal_at(data,#x "\n")) return true |
Enumerations
Alignment
|
Definition at line 194 of file markdown.cpp.
ExplicitPageResult
| strong |
- Enumeration values
Definition at line 66 of file markdown.cpp.
Functions
computeIndentExcludingListMarkers()
| static |
Definition at line 2113 of file markdown.cpp.
References AUTO_TRACE, AUTO_TRACE_EXIT, FALSE, isLiTag, TRUE and Trace::trunc.
Referenced by isCodeBlock and isListMarker.
escapeDoubleQuotes()
| static |
Definition at line 220 of file markdown.cpp.
References AUTO_TRACE, AUTO_TRACE_EXIT, QCString::data, QCString::isEmpty and Trace::trunc.
Referenced by Markdown::Private::writeMarkdownImage.
escapeSpecialChars()
| static |
Definition at line 238 of file markdown.cpp.
References AUTO_TRACE, AUTO_TRACE_EXIT, QCString::data, FALSE, QCString::isEmpty and Trace::trunc.
Referenced by Markdown::Private::processCodeSpan.
findTableColumns()
| static |
Finds the location of the table's contains in the string data.
Only one line will be inspected.
- Parameters
-
[in] data pointer to the string buffer.
[out] start offset of the first character of the table content
[out] end offset of the last character of the table content
[out] columns number of table columns found
- Returns
The offset until the next line in the buffer.
Definition at line 2398 of file markdown.cpp.
References AUTO_TRACE, AUTO_TRACE_EXIT, end, eol, isNewline and Trace::trunc.
Referenced by isTableBlock and Markdown::Private::writeTableBlock.
getFilteredImageAttributes()
| static |
parse the image attributes and return attributes for given format
Definition at line 313 of file markdown.cpp.
References AUTO_TRACE, AUTO_TRACE_EXIT, QCString::find, QCString::left, QCString::lower, QCString::mid, split, QCString::str and QCString::stripWhiteSpace.
Referenced by Markdown::Private::writeMarkdownImage.
hasLineBreak()
| static |
Definition at line 2679 of file markdown.cpp.
References AUTO_TRACE, AUTO_TRACE_EXIT and Trace::trunc.
Referenced by Markdown::Private::writeOneLineHeaderOrRuler.
isBlockQuote()
| static |
returns true if this line starts a block quote
Definition at line 1842 of file markdown.cpp.
References AUTO_TRACE, AUTO_TRACE_EXIT, codeBlockIndent and Trace::trunc.
Referenced by Markdown::Private::processQuotations.
isCodeBlock()
| static |
Definition at line 2305 of file markdown.cpp.
References AUTO_TRACE, AUTO_TRACE_EXIT, codeBlockIndent, computeIndentExcludingListMarkers, FALSE, isEmptyLine, isNewline and Trace::trunc.
Referenced by Markdown::Private::processBlocks.
isEmptyLine()
| static |
Definition at line 2091 of file markdown.cpp.
References AUTO_TRACE, AUTO_TRACE_EXIT and Trace::trunc.
Referenced by isCodeBlock, Markdown::Private::processBlocks and Markdown::Private::processQuotations.
isEndOfList()
| static |
Definition at line 2193 of file markdown.cpp.
References AUTO_TRACE, AUTO_TRACE_EXIT and Trace::trunc.
Referenced by Markdown::Private::processBlocks and Markdown::Private::processQuotations.
isExplicitPage()
| static |
Definition at line 3450 of file markdown.cpp.
References AUTO_TRACE, AUTO_TRACE_EXIT, explicitMainPage, explicitOtherPage, explicitPage, isOtherPage, literal_at, notExplicit, QCString::str and Trace::trunc.
Referenced by MarkdownOutlineParser::parseInput.
isFencedCodeBlock()
| static |
Definition at line 2220 of file markdown.cpp.
References AUTO_TRACE, AUTO_TRACE_EXIT, end, FALSE and Trace::trunc.
Referenced by Markdown::Private::processBlocks and Markdown::Private::processQuotations.
isHRuler()
| static |
Definition at line 1960 of file markdown.cpp.
References AUTO_TRACE, AUTO_TRACE_EXIT and Trace::trunc.
Referenced by Markdown::Private::writeBlockQuote and Markdown::Private::writeOneLineHeaderOrRuler.
isLinkRef()
| static |
returns end of the link ref if this is indeed a link reference.
Definition at line 1871 of file markdown.cpp.
References AUTO_TRACE, AUTO_TRACE_ADD, AUTO_TRACE_EXIT, QCString::clear, end, eol, QCString::isEmpty and Trace::trunc.
Referenced by Markdown::Private::processBlocks.
isListMarker()
| static |
Definition at line 2182 of file markdown.cpp.
References AUTO_TRACE, AUTO_TRACE_EXIT, computeIndentExcludingListMarkers and Trace::trunc.
Referenced by Markdown::Private::processBlocks, Markdown::Private::processQuotations and Markdown::Private::writeBlockQuote.
isNewline()
| inline |
Definition at line 207 of file markdown.cpp.
Reference literal_at.
Referenced by Markdown::Private::findEndOfLine, findTableColumns and isCodeBlock.
isOtherPage()
| static |
Definition at line 3437 of file markdown.cpp.
Reference OPC.
Referenced by isExplicitPage.
isTableBlock()
| static |
Returns TRUE iff data points to the start of a table block.
Definition at line 2439 of file markdown.cpp.
References AUTO_TRACE, AUTO_TRACE_EXIT, end, FALSE, findTableColumns and Trace::trunc.
Referenced by Markdown::Private::processBlocks.
markdownFileNameToId()
|
processes string s and converts markdown into doxygen/html commands.
Definition at line 3600 of file markdown.cpp.
References FileInfo::absFilePath, AUTO_TRACE, AUTO_TRACE_EXIT, escapeCharsInString, QCString::findRev, QCString::left, QCString::str and stripFromPath.
Referenced by DocRef::DocRef, DocSecRefItem::parse and MarkdownOutlineParser::parseInput.
markersToAlignment()
| static |
helper function to convert presence of left and/or right alignment markers to an alignment value
Definition at line 292 of file markdown.cpp.
References AlignCenter, AlignLeft, AlignNone and AlignRight.
Referenced by Markdown::Private::writeTableBlock.
skipOverFileAndLineCommands()
|
Definition at line 2876 of file markdown.cpp.
Reference literal_at.
Referenced by Markdown::Private::writeCodeBlock.
Variables
codeBlockIndent
|
Definition at line 201 of file markdown.cpp.
Referenced by isBlockQuote, isCodeBlock, Markdown::Private::processBlocks and Markdown::Private::writeCodeBlock.
g_doxy_nbsp
|
Definition at line 200 of file markdown.cpp.
Referenced by Markdown::Private::addStrEscapeUtf8Nbsp and Markdown::process.
g_quotationHeaderMap
| static |
- Initialiser
-
= { { "[!note]", "\\note" }, { "[!warning]", "\\warning" }, { "[!tip]", "\\remark" }, { "[!caution]", "\\attention" }, { "[!important]", "\\important" } }
Definition at line 2749 of file markdown.cpp.
Referenced by Markdown::Private::writeBlockQuote.
g_utf8_nbsp
|
Definition at line 199 of file markdown.cpp.
Referenced by Markdown::Private::addStrEscapeUtf8Nbsp.
Macro Definitions
AUTO_TRACE
|
Definition at line 61 of file markdown.cpp.
Referenced by escapeDoubleQuotes, escapeSpecialChars and getFilteredImageAttributes.
AUTO_TRACE_ADD
|
Definition at line 62 of file markdown.cpp.
AUTO_TRACE_EXIT
|
Definition at line 63 of file markdown.cpp.
Referenced by escapeDoubleQuotes, escapeSpecialChars and getFilteredImageAttributes.
extraChar
|
- Value
-
(c=='-' || c=='+' || c=='!' || \ c=='?' || c=='$' || c=='@' || \ c=='&' || c=='*' || c=='_' || c=='%' || \ c=='[' || c=='(' || c=='.' || \ c=='>' || c==':' || c==',' || \ c==';' || c=='\'' || c=='"' || c=='`')
Definition at line 84 of file markdown.cpp.
Referenced by Markdown::Private::processEmphasis.
ignoreCloseEmphChar
|
- Value
-
(c=='(' || c=='{' || c=='[' || (c=='<' && cn!='/') || \ c=='\\' || \ c=='@')
Definition at line 100 of file markdown.cpp.
Referenced by Markdown::Private::findEmphasisChar.
isIdChar
|
- Value
-
((c>='a' && c<='z') || \ (c>='A' && c<='Z') || \ (c>='0' && c<='9') || \ (static_cast<unsigned char>(c)>=0x80))
Definition at line 77 of file markdown.cpp.
Referenced by Markdown::Private::findEmphasisChar, reg::Ex::Private::matchAt, Markdown::Private::processCodeSpan, Markdown::Private::processEmphasis and Markdown::Private::processHtmlTagWrite.
isLiTag
|
- Value
-
(data[(i)]=='<' && \ (data[(i)+1]=='l' || data[(i)+1]=='L') && \ (data[(i)+2]=='i' || data[(i)+2]=='I') && \ (data[(i)+3]=='>'))
Definition at line 2105 of file markdown.cpp.
Referenced by computeIndentExcludingListMarkers.
isOpenEmphChar
|
- Value
-
(c=='\n' || c==' ' || c=='\'' || c=='<' || \ c=='>' || c=='{' || c=='(' || c=='[' || \ c==',' || c==':' || c==';')
Definition at line 93 of file markdown.cpp.
Referenced by Markdown::Private::processEmphasis.
OPC
|
Definition at line 3439 of file markdown.cpp.
Referenced by isOtherPage.
Generated via doxygen2docusaurus by Doxygen 1.14.0.