class Luce::OtherTagBlockHTMLSyntax

Defined in:

luce/block_syntaxes/other_tag_block_html_syntax.cr

Instance Method Summary

Instance methods inherited from class Luce::BlockTagBlockHTMLSyntax

can_parse?(parser : BlockParser) : Bool can_parse?, parse(parser : BlockParser) : Node parse, pattern : Regex pattern

Instance methods inherited from class Luce::BlockHTMLSyntax

can_end_block?(parser : BlockParser) can_end_block?

Instance methods inherited from class Luce::BlockSyntax

can_end_block?(parser : BlockParser) can_end_block?, can_parse?(parser : BlockParser) can_parse?, parse(parser : BlockParser) : Node | Nil parse, parse_child_lines(parser : BlockParser) : Array(String | Nil) parse_child_lines, pattern : Regex pattern

Class methods inherited from class Luce::BlockSyntax

at_block_end?(parser : BlockParser) : Bool at_block_end?, generate_anchor_hash(element : Element) : String generate_anchor_hash

Instance Method Detail

def can_end_block?(parser : BlockParser) : Bool #

def pattern : Regex #

Really hacky way to detect "other" HTML.

This matches:

  • any opening spaces
  • open bracket and maybe a slash ("<" or "</")
  • some word characters
  • either:
    • a close bracket, or
    • whitespace followed by not-brackets followed by a close bracket
  • possible whitespace and the end of the line