Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qtextmarkdownimporter.cpp File Reference

(66595c3efe125cc92333d7a71317cce529c52e92)

#include "qtextmarkdownimporter_p.h"
#include "qtextdocumentfragment_p.h"
#include <QLoggingCategory>
#include <QTextCursor>
#include <QTextDocument>
#include <QTextDocumentFragment>
#include <QTextList>
#include <QTextTable>
#include "../../3rdparty/md4c/md4c.h"
Include dependency graph for qtextmarkdownimporter.cpp:

Go to the source code of this file.

Functions

static constexpr auto lfMarkerString () noexcept
static constexpr auto crlfMarkerString () noexcept
static int CbEnterBlock (MD_BLOCKTYPE type, void *detail, void *userdata)
static int CbLeaveBlock (MD_BLOCKTYPE type, void *detail, void *userdata)
static int CbEnterSpan (MD_SPANTYPE type, void *detail, void *userdata)
static int CbLeaveSpan (MD_SPANTYPE type, void *detail, void *userdata)
static int CbText (MD_TEXTTYPE type, const MD_CHAR *text, MD_SIZE size, void *userdata)
static void CbDebugLog (const char *msg, void *userdata)
static Qt::Alignment MdAlignment (MD_ALIGN a, Qt::Alignment defaultAlignment=Qt::AlignLeft|Qt::AlignVCenter)
static auto splitFrontMatter (QStringView md)

Variables

static const QChar qtmi_Newline = u'\n'
static const QChar qtmi_Space = u' '
static const int qtmi_BlockQuoteIndent

Function Documentation

◆ CbDebugLog()

void CbDebugLog ( const char * msg,
void * userdata )
static

Definition at line 89 of file qtextmarkdownimporter.cpp.

◆ CbEnterBlock()

int CbEnterBlock ( MD_BLOCKTYPE type,
void * detail,
void * userdata )
static

Definition at line 59 of file qtextmarkdownimporter.cpp.

◆ CbEnterSpan()

int CbEnterSpan ( MD_SPANTYPE type,
void * detail,
void * userdata )
static

Definition at line 71 of file qtextmarkdownimporter.cpp.

◆ CbLeaveBlock()

int CbLeaveBlock ( MD_BLOCKTYPE type,
void * detail,
void * userdata )
static

Definition at line 65 of file qtextmarkdownimporter.cpp.

◆ CbLeaveSpan()

int CbLeaveSpan ( MD_SPANTYPE type,
void * detail,
void * userdata )
static

Definition at line 77 of file qtextmarkdownimporter.cpp.

◆ CbText()

int CbText ( MD_TEXTTYPE type,
const MD_CHAR * text,
MD_SIZE size,
void * userdata )
static

Definition at line 83 of file qtextmarkdownimporter.cpp.

◆ crlfMarkerString()

constexpr auto crlfMarkerString ( )
staticconstexprnoexcept

Definition at line 32 of file qtextmarkdownimporter.cpp.

Referenced by splitFrontMatter().

Here is the caller graph for this function:

◆ lfMarkerString()

constexpr auto lfMarkerString ( )
staticconstexprnoexcept

Definition at line 31 of file qtextmarkdownimporter.cpp.

Referenced by splitFrontMatter().

Here is the caller graph for this function:

◆ MdAlignment()

Qt::Alignment MdAlignment ( MD_ALIGN a,
Qt::Alignment defaultAlignment = Qt::AlignLeft | Qt::AlignVCenter )
static

Definition at line 98 of file qtextmarkdownimporter.cpp.

◆ splitFrontMatter()

auto splitFrontMatter ( QStringView md)
static

Split any Front Matter from the Markdown document md. Returns a pair of QStringViews: if md begins with qualifying Front Matter (according to the specification at https://jekyllrb.com/docs/front-matter/ ), put it into the frontMatter view, omitting both markers; and put the remaining Markdown into rest. If no Front Matter is found, return all of md in rest.

Definition at line 131 of file qtextmarkdownimporter.cpp.

References crlfMarkerString(), and lfMarkerString().

Here is the call graph for this function:

Variable Documentation

◆ qtmi_BlockQuoteIndent

const int qtmi_BlockQuoteIndent
static
Initial value:
=
40

Definition at line 35 of file qtextmarkdownimporter.cpp.

◆ qtmi_Newline

const QChar qtmi_Newline = u'\n'
static

Definition at line 28 of file qtextmarkdownimporter.cpp.

◆ qtmi_Space

const QChar qtmi_Space = u' '
static

Definition at line 29 of file qtextmarkdownimporter.cpp.