Skip to content

Commit 0a92612

Browse files
Merge branch 'main' into Refactor-sidepanel-for-multiple-buttons
2 parents 1dc2b2c + 3a5bc69 commit 0a92612

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
2323
- Sidebar panel overflow for plugins (#1266, #1269)
2424
- Extra border around code output in the instructions panel (#1253)
2525
- Line numbering alignment in code blocks in the instructions panel (#1259)
26+
- Extra lines added at the start of some code blocks (#1267)
2627

2728
## [0.33.0] - 2025-10-15
2829

src/components/Menus/Sidebar/InstructionsPanel/InstructionsPanel.jsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ const InstructionsPanel = () => {
2727
"remove-initial-line-feed": true,
2828
"left-trim": false,
2929
});
30+
Prism.hooks.add("before-sanity-check", function (env) {
31+
if (!env.code) return;
32+
33+
// Remove multiple leading blank lines (empty or whitespace-only)
34+
env.code = env.code.replace(/^(?:\s*\n)+/, "");
35+
});
3036
}
3137
}, []);
3238
const [showModal, setShowModal] = useState(false);

0 commit comments

Comments
 (0)