Avoid legacy indented codeblock workaround for remark 11#18312
Merged
fisker merged 3 commits intoNov 26, 2025
Merged
Conversation
commit: |
This comment was marked as outdated.
This comment was marked as outdated.
6495c74 to
0655dc8
Compare
seiyab
commented
Nov 25, 2025
Comment on lines
-184
to
+196
| const text = options.originalText.slice( | ||
| let text = options.originalText.slice( | ||
| orderListItem.position.start.offset, | ||
| orderListItem.position.end.offset, | ||
| ); | ||
| if (options.parser !== "mdx") { | ||
| const firstChild = orderListItem.children[0]; | ||
| if (firstChild?.position) { | ||
| text = options.originalText.slice( | ||
| orderListItem.position.start.offset, | ||
| firstChild.position.start.offset, | ||
| ); | ||
| } | ||
| } |
Collaborator
Author
There was a problem hiding this comment.
Other possible approaches:
let prefixedTextEnd = orderListItem.position.end.offset;
if (options.parser !== "mdx") {
const firstChild = orderListItem.children[0];
if (firsrChild?.position) {
prefixedTextEnd = firstChild.position.start.offset;
}
}
const prefixedText = options.originalText.slice(
orderListItem.position.start.offset,
orderListItem.position.end.offset,
);or
if (options.parser !== "mdx") {
const firstChild = orderListItem.children[0];
if (firstChild?.type === "code" && firstChild.isIndented) {
return { number, leadingSpaces: " " };
}
}
fisker
reviewed
Nov 25, 2025
4 tasks
Member
|
#18321 already merged into remark-11-markdown branch, please rebase. |
…when parser is remark 11 The issue is resolved as of remark 11
0655dc8 to
3c9b908
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
remarkjs/remark#315 was resolved so we no longer need workaround for it.
This PR is already ready to be reviewed and merged.
Checklist
docs/directory).changelog_unreleased/*/XXXX.mdfile followingchangelog_unreleased/TEMPLATE.md.