On loading a file, everything but the first word gets stripped from the info string of code blocks
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 61.6k
- Forks
- 4.6k
- Avg merge
- 23h 49m
- Merged PRs (30d)
- 89
Description
Description
When opening a markdown file, everything but the first word is stripped from the info string of a fenced code block.
- Can you reproduce the issue?
Steps to reproduce
- Create a file
test.mdwith the content
# Test
```json test
{"test":"doesnt matter"}
```
- Open the file in MarkText.
Expected behavior:
I expect MarkText to use the first word of the info string to identify the language for highlighting and ignore the rest. And by "ignore" I mean, do not touch it and when saving the file, write it out to disk, again.
Actual behavior:
Markdown correctly uses the first word of the info string to identify the language for highlighting, but then discards the rest. When the file is saved, only the first word of the info string is written to disk.
Background
I use a Literate Programming system that uses the info string to add labels to code blocks. So, naturely, I need these labels to be preserved when using MarkText for editing.
Versions
- Mark Text version: 0.16.3
- Operating system: Windows 10
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 problem with the test.md file and the fenced block containing the json test info string. Compare the loaded document with the saved output; done means the first word still identifies the language while the remaining info-string text is preserved on disk.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- markdown, typescript
- Domain
- content
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100