StackExchange / StackExchange/Stacks-Editor
Code block within spoiler gives different result than shown in preview
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 437
- Forks
- 61
- Avg merge
- 16h 2m
- Merged PRs (30d)
- 8
Description
Describe the bug
A code block within a spoiler block gives a different result than shown when looking at the Markdown preview before posting/saving an answer.
To Reproduce
When using the following markdown in the answer editor:
>! ```python
>! if True:
>! print "Hello World"
>! ```
It shows this result when viewing the preview during editing (with the multi-line code):
Screenshot is of this answer (it's currently deleted, because it's not yet working as expected)
Note: The markdown only shows as shown in the screenshot when editing an answer and viewing the live markdown preview/result (WYSIWYG), not when editing a question.
Expected behavior
I would expect the result to look like the preview after posting/saving. I also think that being able to post a code block within a spoiler is useful on https://codegolf.stackexchange.com
Desktop (please complete the following information):
- OS: Windows 10, 21H2
- Browser: Chromium 105
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the markdown in the answer editor and compare the live preview with the result after posting or saving. Trace the answer editor's spoiler and code-block rendering paths; done when a code block inside a spoiler renders the same way in preview and in the saved answer.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100
