From 43e93d774e73d01127f002acb9fc6ce56e195b4a Mon Sep 17 00:00:00 2001 From: Jeremy Valentine <38669521+valentine195@users.noreply.github.com> Date: Wed, 3 Jan 2024 16:27:40 -0500 Subject: [PATCH] fix: Fixes clicking on a section/table roller in LP enters the source (close #283) --- src/live-preview.ts | 2 +- src/roller/section.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/live-preview.ts b/src/live-preview.ts index c9da34f..8b8a7eb 100644 --- a/src/live-preview.ts +++ b/src/live-preview.ts @@ -85,7 +85,7 @@ function inlineRender(view: EditorView, plugin: DiceRollerPlugin) { const end = node.to; // don't continue if current cursor position and inline code node (including formatting // symbols) overlap - if (selectionAndRangeOverlap(selection, start, end + 1)) return; + if (selectionAndRangeOverlap(selection, start, end )) return; const original = view.state.doc.sliceString(start, end).trim(); diff --git a/src/roller/section.ts b/src/roller/section.ts index 5b51e1d..bcbc4ef 100644 --- a/src/roller/section.ts +++ b/src/roller/section.ts @@ -104,7 +104,8 @@ export class SectionRoller extends GenericEmbeddedRoller { continue; } - MarkdownRenderer.renderMarkdown( + MarkdownRenderer.render( + app, this.displayFromCache(result), ret.createDiv(), this.source,