Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- In Positron, running a cell that raises an error no longer results in an error toast message (<https://github.com/posit-dev/positron/issues/9845>).
- In Positron, Julia code cells in `.qmd` files can now be executed when the `ntluong95.positron-julia` extension is installed, the same way Python and R do (<https://github.com/quarto-dev/quarto/pull/989>).
- Fixed a bug where soft line breaks within a paragraph were rendered as separate paragraphs in the markdown preview (<https://github.com/quarto-dev/quarto/pull/1027>).

## 1.134.0 (Release on 2026-06-22)

Expand Down
6 changes: 5 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
},
"devDependencies": {
"@types/markdown-it": "^12.2.3",
"@types/markdown-it-attrs": "^4.1.0"
"@types/markdown-it-attrs": "^4.1.0",
"tsx": "^4.7.1"
},
"scripts": {
"test": "node --import tsx --test test/*.test.ts"
}
}
11 changes: 6 additions & 5 deletions packages/core/src/markdownit/divs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ export const divPlugin = (md: MarkdownIt) => {
kDivRuleName,
(state, start, _end, silent) => {

// This is a validation run, can ignore
if (silent) {
return true;
}

// Get the line for parsing
const lineStart = state.bMarks[start] + state.tShift[start];
const lineEnd = state.eMarks[start];
Expand Down Expand Up @@ -85,6 +80,12 @@ export const divPlugin = (md: MarkdownIt) => {
}

if (match) {
// This is a validation run. Report that actual div markers interrupt
// paragraphs, but avoid mutating div state until the parser consumes it.
if (silent) {
return true;
}

// There is a div here, is one already open?
const divFence = match[1];
const attr = match[2];
Expand Down
22 changes: 22 additions & 0 deletions packages/core/test/markdownit-divs.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import assert from "node:assert/strict";
import test from "node:test";

import MarkdownIt from "markdown-it";
import { divPlugin } from "../src/markdownit/divs";

const render = (src: string) => {
const md = new MarkdownIt({ html: true });
md.use(divPlugin);
return md.render(src);
};

test("pandoc divs do not turn soft line breaks into paragraph breaks", () => {
assert.equal(render("Hello\nworld"), "<p>Hello\nworld</p>\n");
});

test("pandoc div markers still interrupt paragraphs", () => {
assert.equal(
render("Before\n:::\nInside\n:::"),
"<p>Before</p>\n<div class=\"quarto-div\"><p>Inside</p>\n</div>"
);
});
Loading