Skip to content

[Bug]: Using standard Markdown code block syntax ``` in a snippet causes everything following to be deleted #696

@BryanWall

Description

@BryanWall

Describe the bug

I just tried moving all of my SnippetsLab snippets to massCode and discovered that massCode will delete everything in a file following 3 consecutive backticks. It doesn't seem to matter what language the file is set to.

Three backticks is the standard for code blocks in Markdown almost everywhere, including Github, so it shouldn't cause part of a snippet to be wiped. It should be possible to store valid Markdown in a snippet.
https://www.markdownguide.org/extended-syntax/#fenced-code-blocks

To reproduce

Assumes that the user is using Markdown as the storage method instead of Sqlite

  1. Create a snippet
  2. Set language to Markdown (or anything else)
  3. Paste in some Markdown content which includes standard Markdown code blocks (surrounded by 3 backticks), or paste in any content and type 3 backticks at the start of a line
  4. Select something else so the snippet is saved to disk, or wait until massCode auto-saves the file
  5. Anything in the file after the first set of 3 backticks is deleted

This happens even if the language is set to "Plain Text". It doesn't have to be set to Markdown for this issue to happen.

The documentation here suggests that code blocks can be displayed in a snippet, so I assume this should be possible:
https://masscode.io/documentation/markdown.html#render-code-blocks

You can use the raw Markdown from this Github project readme.md as an example. Just paste this into a Markdown snippet in massCode and it will delete everything after the first set of 3 backticks after a few seconds:
https://raw.githubusercontent.com/chicagocomputerclasses/SUPERSQL-Google-Sheets-Function/refs/heads/master/README.md

I assume this is happening because massCode uses 3 backticks as the container for fragments.

App Version and Architecture

4.7.1

System info

System:
    OS: macOS 26.3.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 149.80 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions