Skip to content

fix: fix list item wrong indent#3889

Merged
UziTech merged 1 commit intomarkedjs:masterfrom
UziTech:list-wrong-indent
Feb 11, 2026
Merged

fix: fix list item wrong indent#3889
UziTech merged 1 commit intomarkedjs:masterfrom
UziTech:list-wrong-indent

Conversation

@UziTech
Copy link
Member

@UziTech UziTech commented Feb 8, 2026

Marked version: 17.0.1

Description

Fix wrong indent list item not being included in list

Contributor

  • Test(s) exist to ensure functionality and minimize regression (if no tests added, list tests covering this PR); or,
  • no tests required for this PR.
  • If submitting new feature, it has been documented in the appropriate places.

Committer

In most cases, this should be a different person than the contributor.

@vercel
Copy link

vercel bot commented Feb 8, 2026

@UziTech is attempting to deploy a commit to the MarkedJS Team on Vercel.

A member of the Team first needs to authorize it.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @UziTech, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves a parsing bug affecting list items with non-standard indentation, ensuring that all content intended for a list item is correctly associated with it. The core change involves a minor but impactful simplification of blank line detection within the tokenizer, complemented by new dedicated test cases to validate the fix and maintain parsing accuracy for complex list structures.

Highlights

  • List Item Indentation Fix: Corrected an issue where list items with incorrect indentation were not properly recognized and included in the list structure, specifically addressing issue List item content wrong indent #3839.
  • Tokenizer Logic Simplification: The blank line detection logic within the Tokenizer.ts file has been simplified for improved accuracy and readability when parsing list items.
  • New Test Cases: Added new test files (list_wrong_indent.md and list_wrong_indent.html) to specifically cover and prevent regressions for the fixed list indentation scenario.
Changelog
  • src/Tokenizer.ts
    • Refactored the blank line detection within the list item parsing logic to be more concise and accurate, replacing a conditional assignment with a direct assignment.
  • test/specs/new/list_wrong_indent.html
    • Introduced a new HTML test case demonstrating the expected output for a Markdown list with varied indentation, including blank lines and different spacing.
  • test/specs/new/list_wrong_indent.md
    • Added a new Markdown test input file to specifically test the scenario of list items with wrong indentation, which previously caused content to be excluded from the list.
Activity
  • The pull request addresses and fixes issue List item content wrong indent #3839, which reported wrong indent list items not being included in the list.
  • The author, UziTech, has confirmed that tests exist to ensure functionality and minimize regression for this change.
  • The changes are marked for version 17.0.1.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@vercel
Copy link

vercel bot commented Feb 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marked-website Ready Ready Preview, Comment Feb 8, 2026 10:53pm

Request Review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request fixes a bug where list items with incorrect indentation were not parsed correctly. The change in src/Tokenizer.ts simplifies and corrects the logic for detecting blank lines within a list item. The previous implementation was flawed, causing the blankLine flag to not reset properly. The new implementation is direct and correct. The added test cases effectively cover the fix and prevent regressions. The changes look good.

@calculuschild
Copy link
Contributor

This looks good to me

@UziTech UziTech merged commit e031175 into markedjs:master Feb 11, 2026
8 checks passed
github-actions bot pushed a commit that referenced this pull request Feb 11, 2026
## [17.0.2](v17.0.1...v17.0.2) (2026-02-11)

### Bug Fixes

* fix blockquote after list ([#3888](#3888)) ([2a475a1](2a475a1))
* fix empty list item ([#3890](#3890)) ([3fc6a44](3fc6a44))
* fix list item wrong indent ([#3889](#3889)) ([e031175](e031175))
* fix list with tabs ([#3891](#3891)) ([9fc4f8e](9fc4f8e))
* fix strikethrough flanking rules ([#3882](#3882)) ([1a5b124](1a5b124))
@UziTech UziTech deleted the list-wrong-indent branch March 6, 2026 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

List item content wrong indent

2 participants