mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-20 02:37:41 -05:00
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:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user