module Markd::Rule

Direct including types

Defined in:

markd/rule.cr
markd/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|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})"
LINE_ENDING = /\n|\x0d|\x0d\n/
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 = {'#', '`', '~', '*', '+', '_', '=', '<', '>', '-'}
NUMERIC_HTML_ENTITY = /^&#(?:[Xx][0-9a-fA-F]{1,6}|[0-9]{1,7});/
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

Instance Method Detail

abstract def accepts_lines? : Bool #

accepts_line


[View source]
abstract def continue(parser : Parser, container : Node) : ContinueStatus #

continue


[View source]
abstract def match(parser : Parser, container : Node) : MatchValue #

match and parse


[View source]
abstract def token(parser : Parser, container : Node) : Nil #

token finalize


[View source]