Class: Markdown::Merge::Cleanse::CodeFenceSpacing::CodeFenceGrammar Private

Inherits:
Parslet::Parser
  • Object
show all
Defined in:
lib/markdown/merge/cleanse/code_fence_spacing.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Grammar for parsing fenced code blocks with PEG parser.

Recognizes:

  • Any amount of indentation (handles nested lists)

  • Backtick fences (“‘) and tilde fences (~~~)

  • Optional info string (language identifier)

  • Properly handles spacing issues

This PEG grammar is linear-time and cannot have polynomial backtracking, eliminating ReDoS vulnerabilities.