386 questions
0
votes
2
answers
113
views
Standardize/normalize HTML character escapes in Java
I'm trying to compare HTML fragments that have been processed by two different systems, to check that the results are equivalent, in particular regarding character escapes. I need a version of the ...
0
votes
0
answers
69
views
Best Practices for Preserving Hashed Identifiers in Filenames After Character Sanitization for Accurate Merging
We are working with a hashed identifier column (vmid) in a Pandas DataFrame, which has been sanitized to remove special characters due to CSV storage constraints. The sanitization function we used ...
0
votes
1
answer
47
views
How to have an xml (which is taken as a string in the UI) and I need to send this XML in the request body to the backend API. I am getting errors
I am sending a requestDTO as follows:
{
"transportType": 0,
"registerMode": 4,
"siteName": "string",
"destinationAddress": "string",
...
0
votes
0
answers
78
views
jsoup converting '&' to '&' when I set the Element
I am trying to parse an html input using jsoup (v1.18.1), extract elements, extract each attribute value and replace as follows:
> with >
< with <
The method I'm feeding this code ...
1
vote
1
answer
66
views
Special case for < and > [duplicate]
what would I do if i just randomly wanted to write < or > in HTML but I don't want to make it appear as a < or >. I understand I can use Javascript but I'm just wondering if there's ...
0
votes
1
answer
63
views
Using a reserved character (<) in JS with XSLT
I need to adapt an old XSLT file that transforms an XML file into HTML/JS. It doesn't work anymore.
Here is the original JS code generated in XSLT file :
function processVisibility(item, visible) {
...
0
votes
0
answers
49
views
Why are escape characters and formatting markers appearing in my displayed strings?
I have two issues with strings I'm trying to determine a solution for - one is related to formatting markers, and the other is related to escape characters for the "<" and ">"...
1
vote
1
answer
50
views
Why is my powershell function not returning a decoded string
function ReplaceHtmlCharacterCodes {
param(
[string] $pattern
)
# Import the System.Web assembly to use the WebUtility class
Add-Type -AssemblyName System.Web
# Decode the ...
0
votes
0
answers
44
views
Is there any way to include # in the CSV input without breaking the format [duplicate]
In my project I am trying to create CSV report by converting a JSON to comma seperated values enclosed with double quotes. But while in the JSON I have # as a value in some places.
So while ...
-1
votes
2
answers
107
views
When a browser opens a URL with params it hangs and Java App (using UrlRewrite) throws RequestRejectedException: the URL contained ";"
There is a Java, Spring, Tomcat webapp.
One part is responsible for sending activation emails to the newly created users with generated activationUrls (consisting of unique tokens). The email is ...
1
vote
2
answers
565
views
Telegram Bot: a set of characters break out of HTML escape
I have a game telegram bot which uses first name - last name pairs to spell out a top chart of users in a chat by their score. Screenshot example below:
So, every user has a link to them. The actual ...
0
votes
1
answer
1k
views
Display html characters in Svelte
I have a Svelte app REPL where I wish to convert strings to html characters.
<h1>Test html codes</h1>
{#each lines|| [] as line}
<div id="comment-line">
{line}
...
0
votes
1
answer
446
views
Html escape in byte array - xss issue
I have byte array with html and try to escape. I convert byte array to string and replace special characters. When I make replace, my html doesnt work properly. It looks like a string and no css.
How ...
0
votes
2
answers
326
views
Escape html in java using entity numbers instead of names
Java can escape html using e.g. Apache CommonsText StringEscapeUtils but it will use html entity names, not numbers. So > becomes > Is there a library or class or some feasible custom ...
1
vote
1
answer
122
views
HTML Special Character Codes translation in text XSLT 2.0
I receive text from source system with HTML special escape characters in middle of text. Now I need to translate it to the actual character in XSLT 2.0
I/p like
<Data>Lenevo100 f&uuml;r ...
0
votes
0
answers
533
views
Why does my JS URL string's & get converted to #038; on some server setups?
I have a HTML select field with options and some JS which builds a URL and adds it as the value of the options:
<script>
$( document ).ready(function() {
url = '';
url += '?...
0
votes
0
answers
169
views
How to partially escapeHTML in Ruby (dont escape HTML tags)
I ned to write a string that could escape both these strings.
str = "We couldn't help"
str = "We couldn't help."
I achieved that using
CGI.escapeHTML(CGI.unescapeHTML(str))...
1
vote
1
answer
173
views
How to escape an ampersand in an CSS attribute selector?
I'm trying to build a CSS selector that specifically distinguishes between elements that have a background image given as data URI:
<div style="background-image: url("data:image/svg+...
-3
votes
2
answers
127
views
How to caculate the number of all elements including escape sequences in a string? [duplicate]
I have a string, and I have to count all elements in this string.
str = '\r\n\r\n\r\n \r\n \xa0\xa0\r\nIntroduction\r\n\r\n\r\nHello\r\n\r\nWorld\r\nProblems...\r\nHow to calculate numbers...\r\...
0
votes
1
answer
886
views
JSON Parse: Expecting "EOF" got undefined error
Im trying to PARSE this JSON and getting this error Expecting "EOF" got undefined error, not sure not sure what I am missing in line 14.
example:
{
"plotOptions": {
&...
0
votes
1
answer
1k
views
How to replace the escape unicode characters like \u001A in a string to empty spaces
I have a string like A, with unicode escape characters. How can I replace those characters with empty spaces in SQL?
A
My Name is \u001AVinaykumar. I am \u001AFrom AndhraPradesh. I have completed my ...
-1
votes
1
answer
1k
views
Java StringEscapeUtils.escapeHtml4 as regular text
My target is to display special letters of message as regular text after using StringEscapeUtils.escapeHtml4.
Text example:
<html>
<body>
<p>éô</p>
</body>
</html>
...
0
votes
0
answers
160
views
html entities not converting special symbols
I'm using express-validator to sanitize and escape the inputs from body, the input is 2/1 I sanitize as follows:
body("abbreviation")
.notEmpty()
.isLength({ min: 2, max: 11 })
...
0
votes
2
answers
892
views
Escape text in a method instead of in brackets in Vue
I've got a case where I have a text that begins with characters like that I do not want to escape, but then the rest of the string I do want to escape.
In Vue, given text = " &...
1
vote
1
answer
285
views
How to replace \\n with a space from dataframe column? (escape sequence)
I am trying to replace all "\n" with a space in char strings in a column of data in R but not having much luck. (I also will need to get rid of all single backslashes with nothing but haven'...
0
votes
1
answer
520
views
How to detect escape characters looping through string in javascript?
I have a scenario where I need to format a string into an array to display it in a different way to the user. So, when I get an escape character (for a new line) \n I need to add that as a separate ...
0
votes
1
answer
373
views
PHP: How to convert escaped characters to plain text without str_replace
Convert escaped characters/ whitespaces to plain text
I received data from another database and want to data as plain text.
For now it is using \n, \v,\e, \t, etc as escaped characters. But I want to ...
0
votes
2
answers
422
views
Pass JSON via command line whilst command uses both sets of quotes
I am trying to send this query to my command line:
docker exec cardano-node sh -c 'echo {
"type": "PaymentExtendedSigningKeyShelley_ed25519_bip32",
"description": ...
1
vote
1
answer
2k
views
Angular 7 - Encoding and Decoding HTML Entities In [(ngModel)]
I am having an issue with encoding and decoding HTML Entities on a textarea using ngModel. The Back-End needs and is sending the ><"&' as HTML Entities. This seems like it would be ...
0
votes
1
answer
475
views
Sanitizing HTML at onsubmit in a form
I read this and I did the below.
$confirmation = htmlspecialchars( 'return confirm("' . esc_html__( 'Do you really want to delete?', 'tor-child' ) . '");' );
$output .= '<form method=&...
0
votes
2
answers
197
views
In string which have escape characters, How to get element by useing Xpath?
I have a html like this.
<div id="video1" value="<iframe src="https://www.move.com/99"></iframe>"
class="movie"></...
1
vote
1
answer
566
views
Escape custom tags except html tags
I want to escape custom tags except for HTML tags such as strong, bold, italic.
Input: "Hello World! <notification>Name</notification><nat>Nat tag</nat> <strong>...
0
votes
2
answers
2k
views
HTML Unescape is not unescaping special characters
My program does not unescape the HTML special characters for quotes and I can't figure out why. It still displays the special characters in the Terminal.
For example: 'In the comic book "...
1
vote
1
answer
1k
views
How to use escape characters in an alt attribute inside an img element in HTML?
Is this the right way to use escape characters in alt attributes for alt text of an img element?
I have the below code:
<h3>Option 1</h3>
<img src="image.jpg"
alt='Version of "...
2
votes
2
answers
1k
views
Decode chars like &apos into plaintext
So, this is driving me nuts. How can I convert encoded characters like %apos to plaintext? Using Python 3.9.
What I Tried:
string = 'The guy blasts the other guy on 'Russia's ...
0
votes
1
answer
1k
views
How to secure from XSS for services consumed from Angular and non-Angular clients
This question is for an app using an Angular UI (v8.2.14) calling Spring/Java services. I'm trying to figure out how to be secure from XSS vulnerabilities in the most efficient way, but there seem to ...
0
votes
2
answers
751
views
Django Admin format_html_join cannot seperate with new line <br>
format_html_join(
'<br>', '<br><a href="{}">{}</a>', (
(reverse("admin:research_webproductpage_change", args=[wpp.id]), wpp.title[:30]) ...
0
votes
0
answers
224
views
How to stop Hindi language Character or Symbol '।' Converting into HTML Entity Code on blogger
I am using the below script to convert "." into "।" which is the Hindi stop symbol. I am using this code in a blogger post, The script code converts this dot (.) symbol into HTML ...
-2
votes
1
answer
1k
views
How to insert text with apostrophe and other special characters in PHP "echo"? [duplicate]
I can only paste the text as it is (I can add some function around the text however before echoing it) between the echo ''; apostrophes - how can I insert the text in a way that it does not break the ...
0
votes
0
answers
31
views
How to escape html characters when end-to-end encryption is used? [duplicate]
I created a web chat using socket.io, it is end-to-end encrypted chat. I am encrypting data using AES-GCM. The data is encrypted on the client side and decrypted on the other client side. And so I ...
2
votes
1
answer
752
views
Google Apps Script getPlainBody() from GmailMessage class regex not working
this is my first question on stackoverflow so plz let me know how I can improve readability for others.
Am trying to use regex on the string I obtained from getPlainBody() in GmailMessage Class but ...
0
votes
1
answer
405
views
@spring.url macro is not getting HTML escaped
I am using spring-boot + freemarker (standard initialiser project ).
I have a line in my .ftlh file
<a href="<@spring.url '/${customer.email}' />"
class="zenith-link&...
0
votes
1
answer
60
views
Unable to display actual material-ui icon within my nav menu
Using Material-UI icons like <AddOutlinedIcon /> as shown below, how can I actually make the icon appear in my nav menu as atm it displays the tags/word <AddOutlinedIcon /> before my menu ...
0
votes
1
answer
396
views
German Umlaute in PDF
Situation
I am writing a Ruby On Rails application in German and it is able to download PDF files.
User entered strings should be shown in the PDF. Like e.g. the cities:
"Köln" & "...
1
vote
2
answers
1k
views
Break up HTML attribute values into multiple lines
Is there a way to format HTML attribute values so they span across multiple lines?
Essentially I'm asking is there a way to escape a return inside of a regular typed HTML attribute value.
For example ...
1
vote
1
answer
304
views
How to prevent Jsoup from unescaping html?
I am parsing an html string with Jsoup in order to extract just the text, and want to get the exact text, but when I parse strings that include escaped chars Jsoup unescapes them.
For example - if I ...
1
vote
0
answers
300
views
MongoDB automatically replace < with <
i want to replace all < in a string with < and insert it into MongoDB.
But when i insert it, MongoDB automatically replace < with <.
How can i do to prevent it?
This is the code for ...
-1
votes
1
answer
304
views
Single backslash for Ruby gsub replacement value?
Does anyone know how to provide a single backslash as the replacement value in Ruby's gsub method? I thought using double backslashes for the replacement value would result in a single backslash but ...
1
vote
1
answer
3k
views
Getting rid of escape character in Python so that data can be converted to JSON data
I am getting some data out of the cmd terminal through git log and transporting that data to a JSON file. I parsed out the required data out of that JSON file and intended to put that data into a new ...
1
vote
3
answers
4k
views
Is it possible to render svelte component's (end result) HTML code as a string (escape/show raw HTML code)?
I have a simple PrimaryButton.svelte component that contains "HTML" only (no script or style tags) and looks like this:
<button class="btn-primary btn accent--br">Primary ...