module Markd::Rule
Direct including types
- Markd::Rule::BlockQuote
- Markd::Rule::CodeBlock
- Markd::Rule::Document
- Markd::Rule::Heading
- Markd::Rule::HTMLBlock
- Markd::Rule::Item
- Markd::Rule::List
- Markd::Rule::Paragraph
- Markd::Rule::ThematicBreak
Defined in:
markd/rule.crmarkd/rules/block_quote.cr
markd/rules/code_block.cr
markd/rules/document.cr
markd/rules/heading.cr
markd/rules/html_block.cr
markd/rules/item.cr
markd/rules/list.cr
markd/rules/paragraph.cr
markd/rules/thematic_break.cr
Constant Summary
-
ATTRIBUTE =
((("(?:" + "\\s+") + ATTRIBUTE_NAME_STRING) + ATTRIBUTE_VALUE_SPEC_STRING) + "?)"
-
ATTRIBUTE_NAME_STRING =
"[a-zA-Z_:][a-zA-Z0-9:._-]*"
-
ATTRIBUTE_VALUE_SPEC_STRING =
((("(?:" + "\\s*=") + "\\s*") + ATTRIBUTE_VALUE_STRING) + ")"
-
ATTRIBUTE_VALUE_STRING =
((((("(?:" + UNQUOTED_VALUE_STRING) + "|") + SINGLE_QUOTED_VALUE_STRING) + "|") + DOUBLE_QUOTED_VALUE_STRING) + ")"
-
AUTO_LINK =
/^<[A-Za-z][A-Za-z0-9.+-]{1,31}:[^<>\x00-\x20]*>/i
-
CDATA_STRING =
"<!\\[CDATA\\[[\\s\\S]*?\\]\\]>"
-
CLOSE_TAG =
("</" + TAG_NAME_STRING) + "\\s*[>]"
-
CLOSE_TAG_STRING =
"</#{TAG_NAME_STRING}\\s*[>]"
-
CODE_INDENT =
4
-
COMMENT_STRING =
"<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->"
-
DASH =
/--+/
-
DECLARATION_STRING =
"<![A-Z]+" + "\\s+[^>]*>"
-
DOUBLE_QUOTED_VALUE_STRING =
"\"[^\"]*\""
-
ELLIPSIS =
"..."
-
EMAIL_AUTO_LINK =
/^<([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)>/
-
ESCAPABLE =
/^#{ESCAPABLE_STRING}/
-
ESCAPABLE_STRING =
"[!\"#$%&'()*+,./:;<=>?@[\\\\\\]^_`{|}~-]"
-
ESCAPED_CHAR_STRING =
"\\\\" + ESCAPABLE_STRING
-
HTML_BLOCK_CLOSE =
[/<\/(?:script|pre|style)>/i, /-->/, /\?>/, />/, /\]\]>/]
-
HTML_BLOCK_OPEN =
[/^<(?:script|pre|style)(?:\s|>|$)/i, /^<!--/, /^<[?]/, /^<![A-Z]/, /^<!\[CDATA\[/, /^<[\/]?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[123456]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|title|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|[\/]?[>]|$)/i, Regex.new(((("^(?:" + OPEN_TAG) + "|") + CLOSE_TAG) + ")\\s*$", Regex::Options::IGNORE_CASE)]
-
HTML_TAG =
/^#{HTML_TAG_STRING}/i
-
HTML_TAG_STRING =
"(?:#{OPEN_TAG_STRING}|#{CLOSE_TAG_STRING}|#{COMMENT_STRING}|#{PROCESSING_INSTRUCTION_STRING}|#{DECLARATION_STRING}|#{CDATA_STRING})"
-
LINK_DESTINATION_BRACES =
Regex.new(("^(?:[<](?:[^ <>\\t\\n\\\\\\x00]|" + ESCAPED_CHAR_STRING) + "|\\\\)*[>])")
-
LINK_LABEL =
Regex.new(("^\\[(?:[^\\\\\\[\\]]|" + ESCAPED_CHAR_STRING) + "|\\\\){0,}\\]")
-
LINK_TITLE =
Regex.new(("^(?:\"(#{ESCAPED_CHAR_STRING}|[^\"\\x00])*\"" + "|'(#{ESCAPED_CHAR_STRING}|[^'\\x00])*'") + "|\\((#{ESCAPED_CHAR_STRING}|[^)\\x00])*\\))")
-
MAYBE_SPECIAL =
{'#', '`', '~', '*', '+', '_', '=', '<', '>', '-'}
-
OPEN_TAG =
((("<" + TAG_NAME_STRING) + ATTRIBUTE) + "*") + "\\s*/?>"
-
OPEN_TAG_STRING =
"<#{TAG_NAME_STRING}#{ATTRIBUTE}*" + "\\s*/?>"
-
PROCESSING_INSTRUCTION_STRING =
"[<][?].*?[?][>]"
-
PUNCTUATION =
/\p{P}/
-
SINGLE_QUOTED_VALUE_STRING =
"'[^']*'"
-
TAG_NAME_STRING =
"[A-Za-z][A-Za-z0-9-]*"
-
THEMATIC_BREAK =
/^(?:(?:\*[ \t]*){3,}|(?:_[ \t]*){3,}|(?:-[ \t]*){3,})[ \t]*$/
-
TICKS =
/`+/
-
UNQUOTED_VALUE_STRING =
"[^\"'=<>`\\x00-\\x20]+"
-
UNSAFE_DATA_PROTOCOL =
/^data:image\/(?:png|gif|jpeg|webp)/i
-
UNSAFE_PROTOCOL =
/^javascript:|vbscript:|file:|data:/i
-
WHITESPACE =
/[ \t\n\x0b\x0c\x0d]+/
-
WHITESPACE_CHAR =
/^[ \t\n\x0b\x0c\x0d]/
Instance Method Summary
-
#accepts_lines? : Bool
accepts_line
-
#continue(parser : Parser, container : Node) : ContinueStatus
continue
-
#match(parser : Parser, container : Node) : MatchValue
match and parse
-
#token(parser : Parser, container : Node) : Nil
token finalize