Class: Markbridge::Parse

Inherits:
Data
  • Object
show all
Defined in:
lib/markbridge/parse.rb

Overview

Result of a parse-only call (Markbridge.parse_bbcode and friends).

Instance Attribute Summary collapse

Instance Attribute Details

#astAST::Document (readonly)

Returns:



19
# File 'lib/markbridge/parse.rb', line 19

Parse = Data.define(:ast, :format, :unknown_tags, :diagnostics)

#diagnosticsHash{Symbol => Object} (readonly)

Returns format-specific diagnostics. BBCode supplies :auto_closed_tags_count, :depth_exceeded_count, :unclosed_raw_tags. Other parsers supply an empty hash for now.

Returns:

  • (Hash{Symbol => Object})

    format-specific diagnostics. BBCode supplies :auto_closed_tags_count, :depth_exceeded_count, :unclosed_raw_tags. Other parsers supply an empty hash for now.



19
# File 'lib/markbridge/parse.rb', line 19

Parse = Data.define(:ast, :format, :unknown_tags, :diagnostics)

#formatSymbol? (readonly)

Returns :bbcode, :html, :text_formatter_xml, or :mediawiki. nil when synthesized by Markbridge.render from a bare AST node — there was no source document to parse.

Returns:

  • (Symbol, nil)

    :bbcode, :html, :text_formatter_xml, or :mediawiki. nil when synthesized by Markbridge.render from a bare AST node — there was no source document to parse.



19
# File 'lib/markbridge/parse.rb', line 19

Parse = Data.define(:ast, :format, :unknown_tags, :diagnostics)

#unknown_tagsHash{String => Integer} (readonly)

Returns tag-name → occurrence count. Empty for parsers that do not yet track unknown tags.

Returns:

  • (Hash{String => Integer})

    tag-name → occurrence count. Empty for parsers that do not yet track unknown tags.



19
# File 'lib/markbridge/parse.rb', line 19

Parse = Data.define(:ast, :format, :unknown_tags, :diagnostics)