MD::InlineParser Class

class MD::InlineParser

Base class for parsing inlines. More...

Header: #include <md4qt/inline_parser.h>
CMake: find_package(md4qt REQUIRED COMPONENTS md4qt)
target_link_libraries(mytarget PRIVATE md4qt::md4qt)
Inherited By:

MD::AutolinkParser, MD::EmphasisParser, MD::GfmAutolinkParser, MD::HardLineBreakParser, MD::InlineCodeParser, MD::InlineHtmlParser, MD::InlineMathParser, and MD::LinkImageParser

Public Functions

virtual bool check(MD::Line &line, MD::ParagraphStream &stream, MD::InlineContext &ctx, QSharedPointer<MD::Document> doc, const QString &path, const QString &fileName, QStringList &linksToParse, MD::Parser &parser, const MD::ReverseSolidusHandler &rs) = 0
virtual void popState()
virtual void pushState()
virtual QString startDelimiterSymbols() const = 0

Detailed Description

Instances of this class invoke during parsing process for checking specific rules to handle this or that type of an inline.

Member Function Documentation

[pure virtual] bool InlineParser::check(MD::Line &line, MD::ParagraphStream &stream, MD::InlineContext &ctx, QSharedPointer<MD::Document> doc, const QString &path, const QString &fileName, QStringList &linksToParse, MD::Parser &parser, const MD::ReverseSolidusHandler &rs)

Check if current character (string) is handled by this parser.

Returns true if handled, false otherwise.

This method should do a work with context and handle his delimiters and cache in context ready for use object that will be placed into MD::Paragraph.

line Current line.

stream Text stream.

ctx Context.

doc Document.

path Path to Markdown file.

fileName File name of the Markdown file.

linksToParse List of links for further parsing.

parser Parser.

rs Auxiliary struct for checking if first charcter is escaped.

[virtual] void InlineParser::popState()

Pop state of the parser from stack.

See also pushState().

[virtual] void InlineParser::pushState()

Push state of the parser on stack. For some parsers this is needed, as links, for example, parses its description part as paragraph. This is a subject for implementation of parser...

[pure virtual] QString InlineParser::startDelimiterSymbols() const

Returns string with all symbols that can start this kind of inline.