fix-Fixing Incorrect List Numbering When Directly Parsing Markdown Content #2876
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I fixed an issue:
Here's the code content:
It displayed incorrect ordering.
Therefore, I modified the code in remarkDefaultElementRules:
Now it displays correctly.
Here's the test data content:
{
"type": "list",
"ordered": true,
"start": 1,
"spread": false,
"children": [
// ... (contents of the list items)
],
"position": {
"start": {
"line": 50,
"column": 1,
"offset": 1237
},
"end": {
"line": 52,
"column": 64,
"offset": 1385
}
}
}
Here's the transformed data content:
{
"type": "p",
"listStyleType": "decimal",
"indent": 1,
"children": [
{
"text": "《深入理解计算机系统》,重点做完 lab"
}
]
},
// ... (other transformed list items)
Here's the data content after the fix:
{
"type": "p",
"listStyleType": "decimal",
"indent": 1,
"listStart": 0,
"children": [
{
"text": "《深入理解计算机系统》,重点做完 lab"
}
]
},
// ... (other fixed list items)