Tips on avoiding the conversion of the ✳ symbol into an emoji

My issue lies in my ✳ (Eight-Spoked Asterisk) symbol being converted to an emoji on iOS/android devices.

Find more about the Eight-Spoked Asterisk Emoji here.

Could someone guide me on how to prevent the normal symbol ✳ from being transformed into an emoji asterisk? I am using react/typescript.

For instance:

I would like 1234 ✳✳✳✳ ✳✳✳✳ 5678 - this looks good on desktop.

I do not want 1234 1234 ✳️✳️✳️✳️ ✳️✳️✳️✳️ 5678 - this happens on ios/android.

Thank you

EDIT - Here is the function that performs the replacement:

export const hideDigits = (value: string) => {
const parsedValue = value.slice(0, 4) + value.slice(4, value.length -4).replace(/\d/g,'\u2733') + value.slice(value.length -4);
return (
    normalizeVoucherCode(parsedValue)
);

};

Answer №1

This is how I solved it in case anyone was curious!

//Ensuring that ✳︎ is not interpreted as an emoji by using variation selector \u{FE0E}!
const textSymbol = '\u{2733}\u{FE0E}'; 

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Using jQuery idle timeout to abort jQuery AJAX calls in Laravel 5.2

Currently, I have implemented the jQuery Idle Timeout plugin in my Laravel 5.2 system. Everything works perfectly on my local setup using MAMP Pro, but upon uploading it to the development server, I encountered an "Aborted" error in the AJAX get request: ...

What is the best way to delete a specific date from local storage using Angular after saving it with a key

I'm attempting to clear the fields in my object (collectionFilter) from local storage using localStorage.removeItem('collectionFilter'). All fields are removed, except for the date fields. Please note that I am new to JavaScript and Angular. ...

Managing JSON responses from a server using Javascript

I have encountered various similar issues, but none of them have provided a solution for my specific question. On my server, I generate a JSON string and place it in the response: List<String> list = getSomeList(); JSONArray jsArray = new JSONArray( ...

Single parallax movement determined by the position of the mouse cursor, with no margins

Recently came across this interesting code snippet [http://jsfiddle.net/X7UwG/][1]. It displays a parallax effect when moving the mouse to the left, but unfortunately shows a white space when moving to the right. Is there a way to achieve a seamless single ...

Tips for efficiently rendering components in NextJS 13 exclusively on the client side

Currently, I find myself working on a project that demands my components to adjust to constantly changing conditions on the client side. However, it appears that NextJS 13 is leaning towards server-side rendering from what I can gather. I attempted dynamic ...

Working with regular expressions on fieldsets in JavaScript jQuery

I'm facing an issue with a JavaScript regexp and I could really use some assistance. Currently, I have an ajax query result saved in a variable (in this case, a regexp) and I am trying to only match the content within the fieldset tag. Here is a sni ...

Modify mouse pointer when an object is clicked using JavaScript

Greetings, I am in the process of designing a website for a client. I have encountered a challenge in changing the cursor icon when a user performs a mousedown on an object. There is an image on the webpage When the user clicks on the image, the cursor s ...

Tips for updating the icon based on the active or inactive status in ag-grid within an angular application

HTML* <ng-template #actionButtons let-data="data"> <div class="cell-actions"> <a href="javascript:;" (click)="assign()"> <i nz-icon nzType="user-add" nzTheme= ...

The Angular Material md-menu element stubbornly refuses to close when clicked outside, especially if the target element has a fixed position and

I currently have a <md-menu> element implemented in my webpage. By default, the menu will close if clicked anywhere on the page. However, I have noticed that when clicking inside a fixed element with a specified z-index, the menu does not close. < ...

The issue with session storage persisting even after closing the iframe

Encountering a persistent issue where the sessionStorage remains populated even after closing an iframe and opening another one with the same destination. I assumed that the sessionStorage would be reset and start afresh each time. The iframe is contained ...

Obtain the AJAX response in separate div elements depending on whether it is successful or an error

Currently, my jQuery script outputs the result in the same div for error or success messages: HTML <div id="error-message").html(res); JQUERY jQuery('#register-me').on('click',function(){ $("#myform").hide(); jQuery ...

The module 'nodemailer' could not be located

Currently working with the Zapier Code tool, my goal is to send an email with Trello parameters. I've been using JavaScript encoding in combination with node.js for this task. However, every time I attempt to locate the 'nodemailer' module, ...

angular 4 observable is yielding an [object Object]

My frontend is built using Angular 4, while my backend consists of Laravel 5.5 serving as the restful API. When interacting with the backend, everything works smoothly as I am able to send curl requests and receive back the expected JSON response with 2 ke ...

Applying a value to all JSON objects within an array using AngularJS and JavaScript

Tale: I've developed an array ($scope.mainArray) that will be displayed in a <table> with <tr> elements using ng-repeat as shown below: +---+ | 1 | +---+ | 2 | +---+ | 3 | +---+ Each object contains an array which is presented within & ...

Is it possible to turn off security features for a Heroku Postgres database?

My project doesn't involve sensitive data, so I'm not concerned about security vulnerabilities. I believe the issue lies in the connection between the App/server and the DB. I've searched on Youtube and Google for solutions, but the informa ...

Troubleshooting CodeIgniter's AJAX call functionality issue

I have been attempting to test AJAX functionality within CodeIgniter, but unfortunately, I haven't had any success so far. Can someone please point out where I might be making a mistake? Below is my test_page.php: <!DOCTYPE html> <head> ...

Attempting to showcase extensive content based on the selection made in a drop-down menu

As a newcomer to anything beyond basic HTML, I am seeking guidance and assistance (preferably explained at a beginner level) for the following issue. If I have overlooked any crucial rules or concepts in my query, I apologize. I aim to have each selection ...

Encountered an error in AWS Lambda (Node 14.x): SyntaxError - Unexpected token 'export'

As I work on developing a straightforward login and registration system with AWS, I encountered an issue in AWS Lambda while testing my backend using Postman. The error code is detailed below: { "errorType": "Runtime.UserCodeSyntaxError& ...

Issues have arisen with Google Maps functionality following the API integration, resulting in a blank grey

I am experiencing an issue with Google Maps where it is displaying a grey box or sometimes showing nothing/white. I have tried various solutions found online but none of them have worked for me. Does anyone have a solution? I even attempted to change the ...

Using AngularJS to integrate a function within a component

Hey there, I am facing an issue trying to call a function that is in a component. Let me share the code snippet from my component buttonsController: (function(){ "use strict"; angular .module('my') .component('myButton&ap ...