Skip to content

Commit 3a5bc69

Browse files
create-issue-branch[bot]rammodhvadiapatch0
authored
[CC Projects] Extra line added to the start of some code blocks (#1268)
Fixes the following extra line bug in projects-ui editor projects: <img width="540" height="263" alt="image" src="https://github.com/user-attachments/assets/0c56f8d2-ced4-43e8-9c4b-92cb3a812e65" /> closes #1267 --------- Co-authored-by: create-issue-branch[bot] <53036503+create-issue-branch[bot]@users.noreply.github.com> Co-authored-by: Ram Modhvadia <ram.modhvadia@raspberrypi.org> Co-authored-by: Patrick Cherry <patch0@users.noreply.github.com>
1 parent 75a7bd2 commit 3a5bc69

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changelog
22

3-
All notable changes to this project will be documented in this file.
3+
All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

@@ -25,6 +25,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
2525
- Sidebar panel overflow for plugins (#1266, #1269)
2626
- Extra border around code output in the instructions panel (#1253)
2727
- Line numbering alignment in code blocks in the instructions panel (#1259)
28+
- Extra lines added at the start of some code blocks (#1267)
2829

2930
## [0.33.0] - 2025-10-15
3031

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)