Skip to content

fix(prettier-plugin-sentences-per-line): fix position error when dealing with github flavoured markdown - #939

Merged
JoshuaKGoldberg merged 3 commits into
JoshuaKGoldberg:mainfrom
marcalexiei:position-error
Feb 28, 2026
Merged

JoshuaKGoldberg merged 3 commits into
JoshuaKGoldberg:mainfrom
marcalexiei:position-error

Conversation

@marcalexiei

@marcalexiei marcalexiei commented Feb 1, 2026 •

Copy link
Copy Markdown
Contributor

PR Checklist

Overview

Here’s a polished, clearer, and more professional version of your text. I’ve focused on grammar, readability, and technical clarity while keeping all your original details:


The following GitHub-flavored Markdown blockquote:

> [!NOTE]
> AAAAA

was causing the error:

TypeError: Cannot read properties of undefined (reading 'start')

To resolve this, this PR replaces the previous group + breakParent + line logic with a simpler hardlineWithoutBreakParent approach when encountering sentenceBreak.

Additionally, I added a tests folder containing Markdown files along with their expected output.
This makes testing easier compared to embedding strings directly in the code.

😢

@github-actions

This comment has been minimized.

@codecov

codecov Bot commented Feb 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.19%. Comparing base (71f35fa) to head (fda1c8f).
⚠️ Report is 13 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #939      +/-   ##
==========================================
- Coverage   88.35%   88.19%   -0.17%     
==========================================
  Files          11       11              
  Lines         146      144       -2     
  Branches       40       39       -1     
==========================================
- Hits          129      127       -2     
  Misses         16       16              
  Partials        1        1              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@michaelfaith michaelfaith left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for jumping on this!

Comment thread packages/prettier-plugin-sentences-per-line/src/index.test.ts Outdated
Comment thread packages/prettier-plugin-sentences-per-line/src/types/mdast.d.ts
Comment thread packages/prettier-plugin-sentences-per-line/tests/block-quote-multi.md Outdated
@marcalexiei

Copy link
Copy Markdown
Contributor Author

Thanks for jumping on this!

Well, it was a bug introduced by the rewrite of the plugin logic of #871 made by...

drum roll

me!

@marcalexiei marcalexiei changed the title fix(prettier-plugin-sentences-per-line): fix position error when deal… fix(prettier-plugin-sentences-per-line): fix position error when dealing with github flavoured markdown Feb 1, 2026

@michaelfaith michaelfaith left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me 👍

@marcalexiei

Copy link
Copy Markdown
Contributor Author

@JoshuaKGoldberg, when you have the chance, could you please review this?
Thanks in advance

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

🚢

@JoshuaKGoldberg
JoshuaKGoldberg merged commit 26be2c6 into JoshuaKGoldberg:main Feb 28, 2026
12 checks passed
@github-actions github-actions Bot mentioned this pull request Feb 28, 2026
@marcalexiei
marcalexiei deleted the position-error branch March 1, 2026 01:35
JoshuaKGoldberg pushed a commit that referenced this pull request Mar 1, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>prettier-plugin-sentences-per-line: 0.2.3</summary>

##
[0.2.3](https://github.com/JoshuaKGoldberg/sentences-per-line/compare/prettier-plugin-sentences-per-line@v0.2.2...prettier-plugin-sentences-per-line@v0.2.3)
(2026-03-01)


### Bug Fixes

* **prettier-plugin-sentences-per-line:** fix position error when
dealing with github flavoured markdown
([#939](#939))
([26be2c6](26be2c6))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

🐛 Bug: content with GitHub flavoured alerts throws error

3 participants