fix: < & > are parsed with HTML escape symbols (#481)

Adds utils.htmlDecode arround innerHTML to read the code for <py-repl> and
<py-script>, which preserves all newlines, tabs, and < & > characters.

Fix bug #480
This commit is contained in:
andre-dietrich
2022-06-09 23:01:31 +02:00
committed by GitHub
parent 03fee56a54
commit e1622a56fa
2 changed files with 3 additions and 3 deletions

View File

@@ -6,7 +6,7 @@ import { defaultKeymap } from '@codemirror/commands';
import { oneDarkTheme } from '@codemirror/theme-one-dark';
import { componentDetailsNavOpen, loadedEnvironments, mode, pyodideLoaded } from '../stores';
import { addClasses } from '../utils';
import { addClasses, htmlDecode } from '../utils';
import { BaseEvalElement } from './base';
// Premise used to connect to the first available pyodide interpreter
@@ -61,7 +61,7 @@ export class PyRepl extends BaseEvalElement {
connectedCallback() {
this.checkId();
this.code = this.innerHTML;
this.code = htmlDecode(this.innerHTML);
this.innerHTML = '';
const languageConf = new Compartment();