You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@zeppelin.apache.org by "dani1552 (via GitHub)" <gi...@apache.org> on 2026/10/05 07:45:38 UTC

[PR] [ZEPPELIN-6500] Replace ansi-to-react with anser in the React text re… [zeppelin]

dani1552 opened a new pull request, #5536:
URL: https://github.com/apache/zeppelin/pull/5536

   ### What is this PR for?
   `projects/zeppelin-react` rendered ANSI-colored interpreter output through `ansi-to-react`, which comes from the archived nteract project and declares `linkify-it@^3.0.3` (GHSA-22p9-wv53-3rq4). The fix only exists in linkify-it 5.x, so PR #5278 worked around it with an npm `overrides` entry that crosses `ansi-to-react`'s declared range. Nothing would ever prompt us to remove that override.
   
   `linkify-it` only backs `ansi-to-react`'s optional `linkify` prop, which `TextRenderer.tsx` never enabled, and the actual ANSI parsing is done by `anser`. This renders `anser.ansiToJson()` output directly, which removes `ansi-to-react`, `linkify-it`, `escape-carriage`, `uc.micro` and the `linkify-it` override from the tree.
   
   - The rendered DOM (`<pre><code><span style>`) and the color/style mapping are kept.
   - Carriage returns are now handled only by the caller's `checkAndReplaceCarriageReturn()`, removing the duplicate `escapeCarriageReturn()` pass.
   - All active decorations are applied (e.g. bold + underline + strikethrough), where `ansi-to-react` applied only the last one.
   - `ansi-to-react`'s Jupyter-Classic `\b` handling is dropped, matching the Angular `renderText()` (ansi_up), which does not do it either.
   
   ### What type of PR is it?
   Improvement
   
   ### Todos
   * [x] - Render ANSI output with `anser` directly in `TextRenderer.tsx`
   * [x] - Remove `ansi-to-react` and the `linkify-it` override
   * [x] - Add `TextRenderer.spec.tsx`
   
   ### What is the Jira issue?
   https://issues.apache.org/jira/browse/ZEPPELIN-6500
   
   ### How should this be tested?
   * `cd zeppelin-web-angular/projects/zeppelin-react && npm ci && npm test` passes, including the new `TextRenderer.spec.tsx`.
   * `npm ls linkify-it` is empty.
   * `npm audit --audit-level=high` no longer reports `linkify-it`. The remaining high findings (`braces` via `webpack-dev-server`/`ts-loader`) are dev-only and pre-existing on master.
   
   ### Screenshots (if appropriate)
   N/A
   
   ### Questions:
   * Does the license files need to update? No.
   * Is there breaking changes for older versions? No.
   * Does this needs documentation? No.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ZEPPELIN-6500] Replace ansi-to-react with anser in the React text re… [zeppelin]

Posted by "tbonelee (via GitHub)" <gi...@apache.org>.
tbonelee merged PR #5536:
URL: https://github.com/apache/zeppelin/pull/5536


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [ZEPPELIN-6500] Replace ansi-to-react with anser in the React text re… [zeppelin]

Posted by "tbonelee (via GitHub)" <gi...@apache.org>.
tbonelee commented on PR #5536:
URL: https://github.com/apache/zeppelin/pull/5536#issuecomment-5995507897

   Merged into master


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@zeppelin.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org