Update JS dependencies (#26586)

- Update all JS dependencies
- Adapt `ansi_up` import for ESM
- Tested Mermaid and Ansi rendering
This commit is contained in:
silverwind 2023-08-19 10:18:39 +02:00 committed by GitHub
parent 8f936488f7
commit 5feef6d5c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 224 additions and 216 deletions

View file

@ -1,4 +1,4 @@
import AnsiUp from 'ansi_up';
import {AnsiUp} from 'ansi_up';
const replacements = [
[/\x1b\[\d+[A-H]/g, ''], // Move cursor, treat them as no-op
@ -10,7 +10,7 @@ export function renderAnsi(line) {
// create a fresh ansi_up instance because otherwise previous renders can influence
// the output of future renders, because ansi_up is stateful and remembers things like
// unclosed opening tags for colors.
const ansi_up = new (AnsiUp.default || AnsiUp)();
const ansi_up = new AnsiUp();
ansi_up.use_classes = true;
if (line.endsWith('\r\n')) {