Skip to content

Commit 62f6271

Browse files
committed
Fixed immediate rerender. Current release of Obsidian broke this feature.
1 parent faadbc4 commit 62f6271

File tree

5 files changed

+19
-10
lines changed

5 files changed

+19
-10
lines changed

Changelog.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
- 1.3.1 (2025.08.21):
2+
BugFix:
3+
- Fixed immediate rerender. Current release of Obsidian broke this feature.
4+
15
- 1.3.0 (2025.08.15):
26
New:
37
- Semi-interactive prompts

main.js

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "codeblock-customizer",
33
"name": "Codeblock Customizer",
4-
"version": "1.3.0",
4+
"version": "1.3.1",
55
"minAppVersion": "0.15.0",
66
"description": "This Obsidian plugin lets you customize your codeblocks in editing, and reading mode as well.",
77
"author": "mugiwara",

src/main.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,10 @@ export default class CodeBlockCustomizerPlugin extends Plugin {
808808
//const sectionToRerender = renderer.sections.find((s: any) => s.lineStart === lineStart);
809809
let sectionToRerender;
810810
for (const section of renderer.sections) {
811-
if (section.lineStart <= lineStart && section.lineEnd >= lineStart) {
811+
const sectionStartLine = section?.start?.line;
812+
const sectionEndLine = section?.end?.line;
813+
814+
if (sectionStartLine !== undefined && sectionEndLine !== undefined && sectionStartLine <= lineStart && sectionEndLine >= lineStart) {
812815
if (section.el?.querySelector('pre > code')) {
813816
sectionToRerender = section;
814817
break;
@@ -838,7 +841,7 @@ export default class CodeBlockCustomizerPlugin extends Plugin {
838841
target.renderer.queueRender();
839842
}
840843
}
841-
}// rerenderCodeblock
844+
}
842845

843846
async renderReadingViewOnStart() {
844847
this.app.workspace.iterateRootLeaves((currentLeaf: WorkspaceLeaf) => {

versions.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@
88
"1.2.6": "0.15.0",
99
"1.2.7": "0.15.0",
1010
"1.2.8": "0.15.0",
11-
"1.3.0": "0.15.0"
11+
"1.3.0": "0.15.0",
12+
"1.3.1": "0.15.0"
1213
}

0 commit comments

Comments
 (0)