Automattic / Automattic/jetpack

Markdown module regression in support for multiple codeblocks in same document

Open
#35,588 5 comments 0 reactions 0 assignees View on GitHub
[Feature] Markdown [Plugin] Jetpack [Pri] Low [Status] Needs Author Reply [Status] Stale Bug Triaged
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

### Impacted plugin

Jetpack

### Quick summary

At some point, the markdown module in the Jetpack plugin broke its handling of multiple consecutive code blocks consisting of \`\`\` in \ tags, lumping together the non-contiguous blocks instead of treating them separately.

Example of correct behavior before (reproducible now only by disabling the markdown plugin in Jetpack):

![image](https://github.com/Automattic/jetpack/assets/606923/b8638af9-2e15-4949-a8fa-63b2f5f173de)

Versus how it is rendered now after enabling markdown support then updating the post (under 13.1.1):

![image](https://github.com/Automattic/jetpack/assets/606923/f951d59d-9d57-485e-8c8d-7030f5f1c50a)

This may or may not have been a regression introduced after 12.9.3 (which is the version I upgraded from, but it's hard to say because I don't know if I saved the post under 12.9.3 or not).

### Steps to reproduce

You can reproduce the bug by creating a post with the contents of this article:
[article.txt](https://github.com/Automattic/jetpack/files/14227513/article.txt)

### A clear and concise description of what you expected to happen.

Separate code blocks should be rendered, using the \ tags, not the \`\`\` within it.

### What actually happened

The opening \ tag continues past the ending \ tag.

### Impact

One

### Available workarounds?

No and the platform is unusable

### Platform (Simple and/or Atomic)

Self-hosted

### Logs or notes

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the Jetpack markdown module and reproduce the issue using the linked article.txt contents in a self-hosted post. Confirm that consecutive non-contiguous code blocks produce separate

 elements and that the opening tag does not continue past its matching closing tag.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
content
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.