#include <stdio.h>
#include <qglobal.h>
#include <qregexp.h>
#include <qfileinfo.h>
#include <qdict.h>
#include "markdown.h"
#include "growbuf.h"
#include "debug.h"
#include "util.h"
#include "doxygen.h"
#include "commentscan.h"
#include "entry.h"
#include "bufstr.h"
#include "commentcnv.h"
#include "config.h"
#include "section.h"
#include "message.h"
Go to the source code of this file.
Classes | |
struct | LinkRef |
Macros | |
#define | isIdChar(i) |
#define | isOpenEmphChar(i) |
#define | ignoreCloseEmphChar(i) |
#define | isLiTag(i) |
Typedefs | |
typedef int(* | action_t) (GrowBuf &out, const char *data, int offset, int size) |
Enumerations | |
enum | Alignment { AlignNone, AlignLeft, AlignCenter, AlignRight } |
Functions | |
static QDict< LinkRef > | g_linkRefs (257) |
static void | processInline (GrowBuf &out, const char *data, int size) |
static QCString | escapeSpecialChars (const QCString &s) |
static void | convertStringFragment (QCString &result, const char *data, int size) |
static Alignment | markersToAlignment (bool leftMarker, bool rightMarker) |
static QCString | isBlockCommand (const char *data, int offset, int size) |
static int | findEmphasisChar (const char *data, int size, char c, int c_size) |
static int | processEmphasis1 (GrowBuf &out, const char *data, int size, char c) |
static int | processEmphasis2 (GrowBuf &out, const char *data, int size, char c) |
static int | processEmphasis3 (GrowBuf &out, const char *data, int size, char c) |
static int | processNmdash (GrowBuf &out, const char *data, int off, int size) |
static int | processQuoted (GrowBuf &out, const char *data, int, int size) |
static int | processHtmlTag (GrowBuf &out, const char *data, int offset, int size) |
static int | processEmphasis (GrowBuf &out, const char *data, int offset, int size) |
static int | processLink (GrowBuf &out, const char *data, int, int size) |
static int | processCodeSpan (GrowBuf &out, const char *data, int, int size) |
static int | processSpecialCommand (GrowBuf &out, const char *data, int offset, int size) |
static int | isHeaderline (const char *data, int size) |
static bool | isBlockQuote (const char *data, int size, int indent) |
static int | isLinkRef (const char *data, int size, QCString &refid, QCString &link, QCString &title) |
static int | isHRuler (const char *data, int size) |
static QCString | extractTitleId (QCString &title) |
static int | isAtxHeader (const char *data, int size, QCString &header, QCString &id) |
static int | isEmptyLine (const char *data, int size) |
static int | computeIndentExcludingListMarkers (const char *data, int size) |
static bool | isFencedCodeBlock (const char *data, int size, int refIndent, QCString &lang, int &start, int &end, int &offset) |
static bool | isCodeBlock (const char *data, int offset, int size, int &indent) |
int | findTableColumns (const char *data, int size, int &start, int &end, int &columns) |
static bool | isTableBlock (const char *data, int size) |
static int | writeTableBlock (GrowBuf &out, const char *data, int size) |
void | writeOneLineHeaderOrRuler (GrowBuf &out, const char *data, int size) |
static int | writeBlockQuote (GrowBuf &out, const char *data, int size) |
static int | writeCodeBlock (GrowBuf &out, const char *data, int size, int refIndent) |
static void | findEndOfLine (GrowBuf &out, const char *data, int size, int &pi, int &i, int &end) |
static void | writeFencedCodeBlock (GrowBuf &out, const char *data, const char *lng, int blockStart, int blockEnd) |
static QCString | processQuotations (const QCString &s, int refIndent) |
static QCString | processBlocks (const QCString &s, int indent) |
static QCString | extractPageTitle (QCString &docs, QCString &id) |
static QCString | detab (const QCString &s, int &refIndent) |
QCString | processMarkdown (const QCString &fileName, const int lineNr, Entry *e, const QCString &input) |
QCString | markdownFileNameToId (const QCString &fileName) |
Variables | |
static action_t | g_actions [256] |
static Entry * | g_current |
static QCString | g_fileName |
static int | g_lineNr |
const int | codeBlockIndent = 4 |
#define ignoreCloseEmphChar | ( | i | ) |
Definition at line 70 of file markdown.cpp.
#define isIdChar | ( | i | ) |
Definition at line 56 of file markdown.cpp.
#define isLiTag | ( | i | ) |
Definition at line 1301 of file markdown.cpp.
#define isOpenEmphChar | ( | i | ) |
Definition at line 63 of file markdown.cpp.
typedef int(* action_t) (GrowBuf &out, const char *data, int offset, int size) |
Definition at line 84 of file markdown.cpp.
enum Alignment |
Enumerator | |
---|---|
AlignNone | |
AlignLeft | |
AlignCenter | |
AlignRight |
Definition at line 86 of file markdown.cpp.
|
static |
Definition at line 1309 of file markdown.cpp.
|
static |
Definition at line 132 of file markdown.cpp.
Definition at line 2241 of file markdown.cpp.
Definition at line 111 of file markdown.cpp.
Definition at line 2198 of file markdown.cpp.
Definition at line 1234 of file markdown.cpp.
|
static |
looks for the next emph char, skipping other constructs, and stopping when either it is found, or we are at the end of a paragraph.
Definition at line 237 of file markdown.cpp.
|
static |
Definition at line 1875 of file markdown.cpp.
int findTableColumns | ( | const char * | data, |
int | size, | ||
int & | start, | ||
int & | end, | ||
int & | columns | ||
) |
Finds the location of the table's contains in the string data. Only one line will be inspected.
[in] | data | pointer to the string buffer. |
[in] | size | the size of the 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 |
Definition at line 1491 of file markdown.cpp.
|
static |
Definition at line 1252 of file markdown.cpp.
|
static |
Definition at line 183 of file markdown.cpp.
|
static |
returns TRUE if this line starts a block quote
Definition at line 1092 of file markdown.cpp.
|
static |
Definition at line 1415 of file markdown.cpp.
|
static |
Definition at line 1289 of file markdown.cpp.
|
static |
Definition at line 1376 of file markdown.cpp.
|
static |
returns whether the line is a setext-style hdr underline
Definition at line 1069 of file markdown.cpp.
|
static |
Definition at line 1207 of file markdown.cpp.
|
static |
returns end of the link ref if this is indeed a link reference.
Definition at line 1117 of file markdown.cpp.
|
static |
Returns TRUE iff data points to the start of a table block
Definition at line 1530 of file markdown.cpp.
Definition at line 2344 of file markdown.cpp.
helper function to convert presence of left and/or right alignment markers to a alignment value
Definition at line 143 of file markdown.cpp.
Definition at line 2034 of file markdown.cpp.
|
static |
'`' parsing a code span (assuming codespan != 0)
Definition at line 918 of file markdown.cpp.
|
static |
Definition at line 589 of file markdown.cpp.
|
static |
process single emphasis
Definition at line 335 of file markdown.cpp.
|
static |
process double emphasis
Definition at line 366 of file markdown.cpp.
|
static |
Parsing tripple emphasis. Finds the first closing tag, and delegates to the other emph
Definition at line 395 of file markdown.cpp.
|
static |
Process a HTML tag. Note that
..
are treated specially, in the sense that all code inside is written unprocessed
Definition at line 505 of file markdown.cpp.
|
static |
Definition at line 1045 of file markdown.cpp.
|
static |
Definition at line 631 of file markdown.cpp.
QCString processMarkdown | ( | const QCString & | fileName, |
const int | lineNr, | ||
Entry * | e, | ||
const QCString & | s | ||
) |
processes string s and converts markdown into doxygen/html commands.
Definition at line 2298 of file markdown.cpp.
|
static |
Process ndash and mdashes
Definition at line 452 of file markdown.cpp.
Definition at line 1976 of file markdown.cpp.
|
static |
Process quoted section "...", can contain one embedded newline
Definition at line 484 of file markdown.cpp.
|
static |
Definition at line 996 of file markdown.cpp.
|
static |
Definition at line 1768 of file markdown.cpp.
|
static |
Definition at line 1824 of file markdown.cpp.
|
static |
Definition at line 1961 of file markdown.cpp.
void writeOneLineHeaderOrRuler | ( | GrowBuf & | out, |
const char * | data, | ||
int | size | ||
) |
Definition at line 1692 of file markdown.cpp.
|
static |
Definition at line 1568 of file markdown.cpp.
const int codeBlockIndent = 4 |
Definition at line 106 of file markdown.cpp.
|
static |
Definition at line 92 of file markdown.cpp.
|
static |
Definition at line 93 of file markdown.cpp.
|
static |
Definition at line 94 of file markdown.cpp.
|
static |
Definition at line 95 of file markdown.cpp.