Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Commit c10e701

Browse files
fix: load and reload highlight lines
1 parent 28f9d5e commit c10e701

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

studio/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

studio/src/app/popovers/editor/app-code/app-code.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,6 @@ export class AppCode {
235235

236236
const currentHighlight: string = this.selectedElement.getAttribute('highlight-lines');
237237

238-
console.log(currentHighlight, this.highlightLines);
239-
240238
if (currentHighlight === this.highlightLines) {
241239
resolve();
242240
return;

webcomponents/highlight-code/src/components/highlight-code/deckdeckgo-highlight-code.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,9 @@ export class DeckdeckgoHighlightCode {
161161

162162
await this.addAnchors();
163163

164-
await this.addHighlight();
164+
setTimeout(async () => {
165+
await this.addHighlight();
166+
}, 0);
165167

166168
resolve();
167169
} catch (err) {
@@ -206,6 +208,7 @@ export class DeckdeckgoHighlightCode {
206208
private addHighlight(): Promise<void> {
207209
return new Promise<void>(async (resolve) => {
208210
if (this.highlightLines && this.highlightLines.length > 0) {
211+
209212
const rows: number[] = await this.findRowsToHighlight();
210213

211214
if (rows && rows.length > 0) {

webcomponents/highlight-code/src/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<h1>Editable:</h1>
1414

15-
<deckgo-highlight-code language="java" editable="true">
15+
<deckgo-highlight-code language="java" editable="true" highlight-lines="0,2 6,6" style="--deckgo-highlight-code-line-background: lightgrey;">
1616
<code slot="code">interface NumericTest {
1717
boolean computeTest(int n);
1818
}

0 commit comments

Comments
 (0)