json-schema-org / json-schema-org/website
🐛 Bug: Replace deprecated String.substr usages with slice
Open
@Sam-61s is already working on this.
Since Dec 31, 2025.
🐛 Bug
dependencies
Priority: Medium
Status: Accepted
- Dominant language
- HTML
- Stars
- 169
- Forks
- 484
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 6
Description
Describe the bug
Multiple parts of the website codebase still use the deprecated
String.prototype.substr API.
This causes linting/editor warnings
affected files (from lint output):
pages/index.page.tsxpages/blog/index.page.tsxcomponents/StyledMarkdown.tsxcomponents/Sidebar.tsxcomponents/Headlines.tsxcomponents/JsonEditor.tsxlib/getStaticMarkdownPaths.tslib/getPartsOfJson.tslib/getFindResultsByGlobalRegExp.ts
These usages should be replaced with slice or substring as appropriate.
Steps To Reproduce
- Clone json-schema-org/website and install dependencies.
- Check out the latest main branch.
- Run the linter (e.g.,
npm run lintorpnpm lint)
or open the project in an editor with ESLint enabled. - Open any of the files listed above and search for
.substr. - Observe lint/editor warnings about the deprecated substr method.
Expected Behavior
- The codebase does not use String.prototype.substr.
- All string slicing uses standard, well-supported methods
(slice or substring). - The linter and editors show no warnings related to deprecated
string APIs.
Screenshots
No response
Device Information [optional]
- OS:
- Browser:
- version:
Are you working on this issue?
Yes
Do you think this work might require an [Architectural Decision Record (ADR)]? (significant or noteworthy)
No
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.
Assessment
This issue has not been assessed yet.