Conversation
Applied test-driven development approach to improve code quality: - Added 49 new edge case tests (106 tests total, all passing) - Fixed 6 critical bugs: empty list items, code blocks with backticks, empty table cells, unsafe array.pop(), list unindentation calculation, and empty element HTML rendering - Added HTML escaping for XSS protection (escapes &<>"' in attributes) - Tests cover: empty inputs, unicode/emoji, security, nested structures, line endings, malformed markdown, and random strings
- Update CircleCI image from deprecated circleci/node:10.8 to cimg/node:16.20 - Switch from yarn to npm ci for faster, more reliable CI builds - Cache based on package-lock.json instead of package.json - Bump cache version to v2 to invalidate old caches
- Remove CircleCI configuration - Add GitHub Actions workflow with matrix testing - Test on Node.js 16.x, 18.x, and 20.x - Use actions/checkout@v4 and actions/setup-node@v4 - Enable npm caching for faster builds - Run tests and build on all PRs and pushes to main/master
- typescript: 3.1.6 -> 5.9.3 - mocha: 5.2.0 -> 11.7.5 - webpack: 4.24.0 -> 5.102.1 - webpack-cli: 3.2.3 -> 6.0.1 - @types/mocha: 5.2.5 -> 10.0.10 - @types/node: 10.12.9 -> 20.19.24 - parsimmon: 1.12.0 -> 1.18.1 - @types/parsimmon: 1.10.0 -> 1.10.9 - @types/power-assert: 1.4.29 -> 1.5.12 - power-assert: 1.4.1 -> 1.6.1 Fixed all 24 vulnerabilities (0 remaining) All 106 tests passing
Minor version bump warranted by: Features: - Added 49 comprehensive edge case tests (106 total tests) - Added HTML escaping for XSS protection - Migrated from CircleCI to GitHub Actions with matrix testing Bug Fixes: - Fixed empty list items parsing - Fixed code blocks with backticks inside - Fixed empty table cells - Fixed unsafe array.pop() operation - Fixed list unindentation calculation - Fixed empty element HTML rendering Improvements: - Updated all dependencies to latest versions - Fixed 24 security vulnerabilities (0 remaining) - TypeScript 3.1.6 -> 5.9.3 - Mocha 5.2.0 -> 11.7.5 - Webpack 4.24.0 -> 5.102.1 All 106 tests passing. Backwards compatible.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements a test-driven development approach to improve code quality and robustness by adding comprehensive edge case testing and fixing several critical bugs in the markdown parser.
- Added 49 new edge case tests covering empty inputs, unicode/emoji, security (XSS), nested structures, line endings, malformed markdown, and random strings
- Fixed 6 critical bugs: empty list items, backticks in code blocks, empty table cells, unsafe array.pop(), list unindentation calculation, and empty element HTML rendering
- Added HTML escaping for XSS protection in attribute values
- Upgraded development dependencies to modern versions
- Migrated CI from CircleCI to GitHub Actions
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/test-parser.ts | Added 49 comprehensive edge case tests covering security, unicode, empty inputs, nested structures, and malformed markdown |
| src/parser.ts | Fixed 6 bugs in regex patterns, array operations, list indentation calculation, and added HTML escaping for XSS protection |
| package.json | Updated all development dependencies to modern versions (mocha 11.x, TypeScript 5.x, webpack 5.x, Node types 20.x) |
| .github/workflows/ci.yml | Added new GitHub Actions CI workflow testing on Node 16.x, 18.x, and 20.x |
| .circleci/config.yml | Removed deprecated CircleCI configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Applied test-driven development approach to improve code quality: