Class Parser
java.lang.Object
com.vladsch.flexmark.parser.Parser
- All Implemented Interfaces:
IParse
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<CustomBlockParserFactory> private final List<List<BlockPreProcessorFactory>> private final BitSetprivate final Map<Character, DelimiterProcessor> static final DataKey<Collection<Extension>> Name spaces are allowed in HTML elements, default false for backward compatibilityBlank line interrupts HTML block when not in raw tag, otherwise only when closedblank line interrupts partially open tag ie.open tags must be contained on one lineIndented code can interrupt HTML blockOther markdown elements can interrupt a closed block without an intervening blank lineprivate final List<InlineParserExtensionFactory> private final InlineParserFactoryprivate final LinkRefProcessorDataLINKS_ALLOW_MATCHED_PARENTHESES default true, when false makes parsing CommonMark Spec 0.27 compliantprivate final @NotNull DataHolderprivate final List<List<ParagraphPreProcessorFactory>> static final DataKey<ParserEmulationProfile> private final List<PostProcessorManager.PostProcessorDependencyStage> static final DataKey<ReferenceRepository> static final DataKey<List<SpecialLeadInHandler>> private final BitSetSTRONG_WRAPS_EMPHASIS default false, when true makes parsing CommonMark Spec 0.27 compliantUsed by formatter for translation parsing -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MutableDataHolderaddExtensions(MutableDataHolder options, Extension... extensions) Add extension(s) to the extension liststatic Parser.Builderbuilder()Create a new builder for configuring aParser.static Parser.Builderbuilder(DataHolder options) @NotNull DataHolderGet Options for parsing@NotNull Documentparse(@NotNull BasedSequence input) Parse the specified input text into a tree of nodes.@NotNull DocumentParse the specified input text into a tree of nodes.@NotNull DocumentparseReader(@NotNull Reader input) Parse the specified reader into a tree of nodes.private DocumentpostProcess(Document document) static MutableDataHolderremoveExtensions(MutableDataHolder options, Class... extensions) Remove extension(s) of given class from the extension listbooleantransferReferences(@NotNull Document document, @NotNull Document included, Boolean onlyIfUndefined) Transfer reference definition between documentsstatic <T extends Node>
booleantransferReferences(NodeRepository<T> destination, NodeRepository<T> included, boolean onlyIfUndefined)
-
Field Details
-
EXTENSIONS
-
REFERENCES_KEEP
-
REFERENCES
-
ASTERISK_DELIMITER_PROCESSOR
-
TRACK_DOCUMENT_LINES
-
BLOCK_QUOTE_PARSER
-
BLOCK_QUOTE_EXTEND_TO_BLANK_LINE
-
BLOCK_QUOTE_IGNORE_BLANK_LINE
-
BLOCK_QUOTE_ALLOW_LEADING_SPACE
-
BLOCK_QUOTE_INTERRUPTS_PARAGRAPH
-
BLOCK_QUOTE_INTERRUPTS_ITEM_PARAGRAPH
-
BLOCK_QUOTE_WITH_LEAD_SPACES_INTERRUPTS_ITEM_PARAGRAPH
-
FENCED_CODE_BLOCK_PARSER
-
MATCH_CLOSING_FENCE_CHARACTERS
-
FENCED_CODE_CONTENT_BLOCK
-
CODE_SOFT_LINE_BREAKS
-
HARD_LINE_BREAK_LIMIT
-
HEADING_PARSER
-
HEADING_SETEXT_MARKER_LENGTH
-
HEADING_NO_ATX_SPACE
-
ESCAPE_HEADING_NO_ATX_SPACE
-
HEADING_NO_EMPTY_HEADING_WITHOUT_SPACE
-
HEADING_NO_LEAD_SPACE
-
HEADING_CAN_INTERRUPT_ITEM_PARAGRAPH
-
HTML_BLOCK_PARSER
-
HTML_COMMENT_BLOCKS_INTERRUPT_PARAGRAPH
-
HTML_FOR_TRANSLATOR
-
INLINE_DELIMITER_DIRECTIONAL_PUNCTUATIONS
-
INDENTED_CODE_BLOCK_PARSER
-
INDENTED_CODE_NO_TRAILING_BLANK_LINES
-
INTELLIJ_DUMMY_IDENTIFIER
-
MATCH_NESTED_LINK_REFS_FIRST
-
PARSE_INNER_HTML_COMMENTS
-
PARSE_MULTI_LINE_IMAGE_URLS
-
PARSE_JEKYLL_MACROS_IN_URLS
-
SPACE_IN_LINK_URLS
-
SPACE_IN_LINK_ELEMENTS
-
WWW_AUTO_LINK_ELEMENT
-
LINK_TEXT_PRIORITY_OVER_LINK_REF
-
REFERENCE_PARAGRAPH_PRE_PROCESSOR
-
THEMATIC_BREAK_PARSER
-
THEMATIC_BREAK_RELAXED_START
-
UNDERSCORE_DELIMITER_PROCESSOR
-
BLANK_LINES_IN_AST
-
USE_HARDCODED_LINK_ADDRESS_PARSER
-
STRONG_WRAPS_EMPHASIS
-
LINKS_ALLOW_MATCHED_PARENTHESES
-
LIST_BLOCK_PARSER
-
PARSER_EMULATION_PROFILE
-
HTML_BLOCK_DEEP_PARSER
-
HTML_BLOCK_DEEP_PARSE_NON_BLOCK
-
HTML_BLOCK_COMMENT_ONLY_FULL_LINE
-
HTML_BLOCK_START_ONLY_ON_BLOCK_TAGS
-
HTML_BLOCK_TAGS
-
HTML_BLOCK_DEEP_PARSE_BLANK_LINE_INTERRUPTS
-
HTML_BLOCK_DEEP_PARSE_FIRST_OPEN_TAG_ON_ONE_LINE
-
HTML_BLOCK_DEEP_PARSE_MARKDOWN_INTERRUPTS_CLOSED
-
HTML_BLOCK_DEEP_PARSE_BLANK_LINE_INTERRUPTS_PARTIAL_TAG
-
HTML_BLOCK_DEEP_PARSE_INDENTED_CODE_INTERRUPTS
-
HTML_ALLOW_NAME_SPACE
-
TRANSLATION_HTML_BLOCK_TAG_PATTERN
-
TRANSLATION_HTML_INLINE_TAG_PATTERN
-
TRANSLATION_AUTOLINK_TAG_PATTERN
-
LISTS_CODE_INDENT
-
LISTS_ITEM_INDENT
-
LISTS_NEW_ITEM_CODE_INDENT
-
LISTS_ITEM_MARKER_SPACE
-
LISTS_ITEM_MARKER_SUFFIXES
-
LISTS_NUMBERED_ITEM_MARKER_SUFFIXED
-
LISTS_AUTO_LOOSE
-
LISTS_AUTO_LOOSE_ONE_LEVEL_LISTS
-
LISTS_LOOSE_WHEN_PREV_HAS_TRAILING_BLANK_LINE
-
LISTS_LOOSE_WHEN_LAST_ITEM_PREV_HAS_TRAILING_BLANK_LINE
-
LISTS_LOOSE_WHEN_HAS_NON_LIST_CHILDREN
-
LISTS_LOOSE_WHEN_BLANK_LINE_FOLLOWS_ITEM_PARAGRAPH
-
LISTS_LOOSE_WHEN_HAS_LOOSE_SUB_ITEM
-
LISTS_LOOSE_WHEN_HAS_TRAILING_BLANK_LINE
-
LISTS_LOOSE_WHEN_CONTAINS_BLANK_LINE
-
LISTS_DELIMITER_MISMATCH_TO_NEW_LIST
-
LISTS_END_ON_DOUBLE_BLANK
-
LISTS_ITEM_TYPE_MISMATCH_TO_NEW_LIST
-
LISTS_ITEM_TYPE_MISMATCH_TO_SUB_LIST
-
LISTS_ORDERED_ITEM_DOT_ONLY
-
LISTS_ORDERED_LIST_MANUAL_START
-
LISTS_ITEM_CONTENT_AFTER_SUFFIX
-
LISTS_BULLET_ITEM_INTERRUPTS_PARAGRAPH
-
LISTS_ORDERED_ITEM_INTERRUPTS_PARAGRAPH
-
LISTS_ORDERED_NON_ONE_ITEM_INTERRUPTS_PARAGRAPH
-
LISTS_EMPTY_BULLET_ITEM_INTERRUPTS_PARAGRAPH
-
LISTS_EMPTY_ORDERED_ITEM_INTERRUPTS_PARAGRAPH
-
LISTS_EMPTY_ORDERED_NON_ONE_ITEM_INTERRUPTS_PARAGRAPH
-
LISTS_BULLET_ITEM_INTERRUPTS_ITEM_PARAGRAPH
-
LISTS_ORDERED_ITEM_INTERRUPTS_ITEM_PARAGRAPH
-
LISTS_ORDERED_NON_ONE_ITEM_INTERRUPTS_ITEM_PARAGRAPH
-
LISTS_EMPTY_BULLET_ITEM_INTERRUPTS_ITEM_PARAGRAPH
-
LISTS_EMPTY_ORDERED_ITEM_INTERRUPTS_ITEM_PARAGRAPH
-
LISTS_EMPTY_ORDERED_NON_ONE_ITEM_INTERRUPTS_ITEM_PARAGRAPH
-
LISTS_EMPTY_BULLET_SUB_ITEM_INTERRUPTS_ITEM_PARAGRAPH
-
LISTS_EMPTY_ORDERED_SUB_ITEM_INTERRUPTS_ITEM_PARAGRAPH
-
LISTS_EMPTY_ORDERED_NON_ONE_SUB_ITEM_INTERRUPTS_ITEM_PARAGRAPH
-
LISTS_ITEM_PREFIX_CHARS
-
SPECIAL_LEAD_IN_HANDLERS
-
CODE_BLOCK_INDENT
-
blockParserFactories
-
delimiterProcessors
-
delimiterCharacters
-
specialCharacters
-
postProcessorDependencies
-
paragraphPreProcessorFactories
-
blockPreProcessorDependencies
-
linkRefProcessors
-
inlineParserExtensionFactories
-
inlineParserFactory
-
options
-
-
Constructor Details
-
Parser
Parser(Parser.Builder builder)
-
-
Method Details
-
builder
Create a new builder for configuring aParser.- Returns:
- a builder
-
builder
-
parse
Parse the specified input text into a tree of nodes.Note that this method is thread-safe (a new parser state is used for each invocation).
-
parse
Parse the specified input text into a tree of nodes.Note that this method is thread-safe (a new parser state is used for each invocation).
-
parseReader
Parse the specified reader into a tree of nodes. The caller is responsible for closing the reader.Note that this method is thread-safe (a new parser state is used for each invocation).
- Specified by:
parseReaderin interfaceIParse- Parameters:
input- the reader to parse- Returns:
- the root node
- Throws:
IOException- when reading throws an exception
-
postProcess
-
getOptions
Description copied from interface:IParseGet Options for parsing- Specified by:
getOptionsin interfaceIParse- Returns:
- DataHolder for options
-
transferReferences
public boolean transferReferences(@NotNull @NotNull Document document, @NotNull @NotNull Document included, Boolean onlyIfUndefined) Description copied from interface:IParseTransfer reference definition between documents- Specified by:
transferReferencesin interfaceIParse- Parameters:
document- destination documentincluded- source documentonlyIfUndefined- true if only should transfer references not already defined in the destination document, false to transfer all, null to use repository's KEEP_TYPE to make the determination (if KEEP_FIRST then only transfer if undefined,- Returns:
- true if any references were transferred
-
transferReferences
public static <T extends Node> boolean transferReferences(NodeRepository<T> destination, NodeRepository<T> included, boolean onlyIfUndefined) -
addExtensions
Add extension(s) to the extension list- Parameters:
options- mutable options holding existing extensionsextensions- extension to add- Returns:
- mutable options
-
removeExtensions
Remove extension(s) of given class from the extension list- Parameters:
options- mutable options holding existing extensionsextensions- extension classes to remove- Returns:
- mutable options
-