Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

All notable changes to this project will be documented in this file.
All notable changes to this project will be documented in this file.

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).

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

## [0.33.0] - 2025-10-15

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,25 @@ import RemoveInstructionsModal from "../../../Modals/RemoveInstructionsModal";
import Prism from "prismjs";
import populateMarkdownTemplate from "../../../../utils/populateMarkdownTemplate";

let prismConfigured = false;
Comment thread
rammodhvadia marked this conversation as resolved.
Outdated

const InstructionsPanel = () => {
useEffect(() => {
// prism and prism plugin config
Prism.manual = true;
if (Prism.plugins.NormalizeWhitespace) {
if (Prism.plugins.NormalizeWhitespace && !prismConfigured) {
Prism.plugins.NormalizeWhitespace.setDefaults({
"remove-indent": false,
"remove-initial-line-feed": true,
"left-trim": false,
});
Prism.hooks.add("before-sanity-check", function (env) {
if (!env.code) return;

// Remove multiple leading blank lines (empty or whitespace-only)
env.code = env.code.replace(/^(?:\s*\n)+/, "");
Comment thread
patch0 marked this conversation as resolved.
});
Comment thread
rammodhvadia marked this conversation as resolved.
prismConfigured = true;
}
}, []);
const [showModal, setShowModal] = useState(false);
Expand Down
Loading