Automattic / Automattic/jetpack
Markdown module regression in support for multiple codeblocks in same document
- 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):

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

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
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