iachat/app/services/messages/markdown_renderers
Pranav 79381a4c5f
fix: Add code_block method to WhatsApp and Instagram markdown renderers (#13166)
Problem: SystemStackError: stack level too deep occurred when rendering
messages with indented content (4+ spaces) for WhatsApp, Instagram, and
Facebook channels.

Root Cause: CommonMarker::Renderer#code_block contains a self-recursive
placeholder that must be overridden:
```
  def code_block(node)
    code_block(node)  # calls itself infinitely
  end
```

WhatsAppRenderer and InstagramRenderer were missing this override,
causing infinite recursion when markdown with 4-space indentation
(interpreted as code blocks) was rendered.

Fix: Added code_block method to both renderers that outputs the node
content as plain text:
```
  def code_block(node)
    out(node.string_content)
  end
 ```

Fix https://linear.app/chatwoot/issue/CW-6217/systemstackerror-stack-level-too-deep-systemstackerror
2025-12-30 11:25:54 -08:00
..
base_markdown_renderer.rb feat: Standardize rich editor across all channels (#12600) 2025-12-08 14:43:45 +05:30
instagram_renderer.rb fix: Add code_block method to WhatsApp and Instagram markdown renderers (#13166) 2025-12-30 11:25:54 -08:00
line_renderer.rb feat: Standardize rich editor across all channels (#12600) 2025-12-08 14:43:45 +05:30
plain_text_renderer.rb fix: preserve newlines and formatting in Twilio WhatsApp messages (#13022) 2025-12-08 22:04:30 +05:30
telegram_renderer.rb feat: Standardize rich editor across all channels (#12600) 2025-12-08 14:43:45 +05:30
whats_app_renderer.rb fix: Add code_block method to WhatsApp and Instagram markdown renderers (#13166) 2025-12-30 11:25:54 -08:00