Skip to content

fix: fix multiline list item adds extra newline to raw#3735

Merged
UziTech merged 5 commits into
markedjs:masterfrom
UziTech:fix--fix-multiline-list-adds-extra-newline-to-raw
Aug 4, 2025
Merged

fix: fix multiline list item adds extra newline to raw#3735
UziTech merged 5 commits into
markedjs:masterfrom
UziTech:fix--fix-multiline-list-adds-extra-newline-to-raw

Conversation

@UziTech
Copy link
Copy Markdown
Member

@UziTech UziTech commented Jul 23, 2025

Marked version: 16.1.1

Description

A multiline list item currently gets an extra newline in the raw property

- line 1
  line 2

Tokens:

  {
    type: 'list',
    raw: '- line 1\n  line 2\n',
    ordered: false,
    start: '',
    loose: false,
    items: [
      {
        type: 'list_item',
        raw: '- line 1\n  line 2',
        task: false,
        checked: undefined,
        loose: false,
        text: 'line 1\nline 2',
        tokens: [{
          type: 'text',
-         raw: 'line 1\n\nline 2',
+         raw: 'line 1\nline 2',
          text: 'line 1\nline 2',
          tokens: [{ type: 'text', raw: 'line 1\nline 2', text: 'line 1\nline 2', escaped: false }],
        }],
      },
    ],
  },

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
Copy Markdown

vercel Bot commented Jul 23, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
marked-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 3, 2025 5:19pm

@UziTech UziTech force-pushed the fix--fix-multiline-list-adds-extra-newline-to-raw branch from 65e18b9 to 25a3a98 Compare August 3, 2025 16:45
@UziTech UziTech merged commit e76453e into markedjs:master Aug 4, 2025
8 checks passed
github-actions Bot pushed a commit that referenced this pull request Aug 4, 2025
## [16.1.2](v16.1.1...v16.1.2) (2025-08-04)

### Bug Fixes

* fix multiline list item adds extra newline to raw ([#3735](#3735)) ([e76453e](e76453e))
vaernion pushed a commit to Arbeidstilsynet/brevgen2 that referenced this pull request Dec 3, 2025
This PR contains the following updates:

| Package | Change | Age | Confidence |
|---|---|---|---|
| [marked](https://marked.js.org) ([source](https://github.com/markedjs/marked)) | [`15.0.12` -> `16.2.0`](https://renovatebot.com/diffs/npm/marked/15.0.12/16.2.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/marked/16.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/marked/15.0.12/16.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>markedjs/marked (marked)</summary>

### [`v16.2.0`](https://github.com/markedjs/marked/releases/tag/v16.2.0)

[Compare Source](markedjs/marked@v16.1.2...v16.2.0)

##### Features

- add def token in tokens and renderer ([#&#8203;3745](markedjs/marked#3745)) ([0769124](markedjs/marked@0769124))

### [`v16.1.2`](https://github.com/markedjs/marked/releases/tag/v16.1.2)

[Compare Source](markedjs/marked@v16.1.1...v16.1.2)

##### Bug Fixes

- fix multiline list item adds extra newline to raw ([#&#8203;3735](markedjs/marked#3735)) ([e76453e](markedjs/marked@e76453e))

### [`v16.1.1`](https://github.com/markedjs/marked/releases/tag/v16.1.1)

[Compare Source](markedjs/marked@v16.1.0...v16.1.1)

##### Bug Fixes

- fix stong and em tokens in angle brackets ([#&#8203;3731](markedjs/marked#3731)) ([ad8535c](markedjs/marked@ad8535c))

### [`v16.1.0`](https://github.com/markedjs/marked/releases/tag/v16.1.0)

[Compare Source](markedjs/marked@v16.0.0...v16.1.0)

##### Features

- add generic types for parser and renderer output ([#&#8203;3722](markedjs/marked#3722)) ([39a0ee3](markedjs/marked@39a0ee3))

### [`v16.0.0`](https://github.com/markedjs/marked/releases/tag/v16.0.0)

[Compare Source](markedjs/marked@v15.0.12...v16.0.0)

##### Bug Fixes

- remove cjs build & update min node to 20 ([#&#8203;3687](markedjs/marked#3687)) ([0a35d8f](markedjs/marked@0a35d8f))

##### BREAKING CHANGES

- minify ./lib/marked.esm.js and ./lib/marked.umd.js
- remove ./marked.min.js use ./lib/marked.umd.js instead
- remove ./lib/marked.cjs
- update minimum supported node version to 20 to support `require('marked.esm.js')`. see https://nodejs.org/docs/latest-v20.x/api/modules.html#loading-ecmascript-modules-using-require

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (...
@UziTech UziTech deleted the fix--fix-multiline-list-adds-extra-newline-to-raw branch March 6, 2026 23:01
Logiclayer1111 pushed a commit to Logiclayer1111/marked that referenced this pull request Apr 20, 2026
## [16.1.2](markedjs/marked@v16.1.1...v16.1.2) (2025-08-04)

### Bug Fixes

* fix multiline list item adds extra newline to raw ([#3735](markedjs/marked#3735)) ([0120e8e](markedjs/marked@0120e8e))
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.

2 participants