Skip to content

chore: rename escape helper function#3900

Merged
UziTech merged 3 commits intomarkedjs:masterfrom
UziTech:update-helpers
Feb 18, 2026
Merged

chore: rename escape helper function#3900
UziTech merged 3 commits intomarkedjs:masterfrom
UziTech:update-helpers

Conversation

@UziTech
Copy link
Member

@UziTech UziTech commented Feb 17, 2026

Description

Rename escape helper function to escapeHtmlEntities to avoid confusion1 2 with the global escape function that is deprecated.

I also removed the unescape helper function since it is not used anywhere.

Our helper functions are not exported so changing the name shouldn't cause any external issues unless someone is importing the file directly (which we don't support).

Contributor

  • Test(s) exist to ensure functionality and minimize regression (if no tests added, list tests covering this PR); or,
  • no tests required for this PR.
  • If submitting new feature, it has been documented in the appropriate places.

Committer

In most cases, this should be a different person than the contributor.

@vercel
Copy link

vercel bot commented Feb 17, 2026

@UziTech is attempting to deploy a commit to the MarkedJS Team on Vercel.

A member of the Team first needs to authorize it.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @UziTech, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on improving code clarity and maintainability by addressing potential naming conflicts and removing unused code. The primary change involves renaming a utility function to be more descriptive and avoid collision with a deprecated global JavaScript function, ensuring a clearer understanding of its purpose. Additionally, an obsolete helper function has been removed, streamlining the codebase.

Highlights

  • Function Renaming: The escape helper function has been renamed to escapeHtmlEntities to prevent confusion with the deprecated global escape function in JavaScript.
  • Code Cleanup: The unescape helper function has been removed as it was no longer used anywhere in the codebase, reducing dead code.
Changelog
  • src/Instance.ts
    • Updated the import statement for the HTML escaping helper.
    • Modified the call to the HTML escaping helper function within error handling.
  • src/Renderer.ts
    • Updated the import statement for the HTML escaping helper.
    • Modified all calls to the HTML escaping helper function across various rendering methods (e.g., code, codespan, link, image, text).
  • src/helpers.ts
    • Renamed the escape function to escapeHtmlEntities.
    • Removed the unescape function as it was no longer in use.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@vercel
Copy link

vercel bot commented Feb 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marked-website Ready Ready Preview, Comment Feb 18, 2026 4:11pm

Request Review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request successfully renames the escape helper function to escapeHtmlEntities across the codebase, addressing potential confusion with the deprecated global escape function. Additionally, the unused unescape helper function has been correctly removed. However, there is one instance where the old function name was not updated, which needs to be corrected for full consistency.

Copy link
Member

@styfle styfle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see now, thanks! 😄

@UziTech UziTech merged commit 8045055 into markedjs:master Feb 18, 2026
8 checks passed
@UziTech UziTech deleted the update-helpers branch March 6, 2026 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace Deprecated espace Function with Custom HTML Escaping Implementation

2 participants