Questions tagged [html-escape-characters]
HTML escape characters are special codes, used to display Unicode characters including those which can't be typed on a standard keyboard and those having a special meaning to HTML.
360
questions
0
votes
1
answer
32
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
26
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"></...
2
votes
1
answer
75
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
67
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 "...
0
votes
1
answer
94
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 "...
1
vote
2
answers
53
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
263
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
61
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
67
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
188
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
29
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
157
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
53
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
27
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
76
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" & "...
0
votes
2
answers
111
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
48
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 ...
0
votes
0
answers
102
views
How to use escape sequence in angular 8 [duplicate]
How can i Use the \n to display the content in next line while using interpolation in angular.I want the certain content to go to next line by using \n.
In app.component.ts
public country = "...
0
votes
0
answers
74
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
93
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 ...
0
votes
1
answer
444
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
2
answers
810
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 ...
0
votes
0
answers
222
views
Escape backslash from the json created through requests.get()
I am gathering data through requests.get() from a rest-api url and modifying that data and pushing the modified data back again to the link through requests.put(). Problem is that the modified html ...
0
votes
0
answers
56
views
Rails html_escape all values
I would like to escape all the attributes of a model when fetching the data from DB so that it would avoid XSS. Also, if there are any new columns added in the future it should be escaped by default ...
1
vote
0
answers
145
views
Unmarshaller with custom unescaping some symbols utf-8 and utf-16
I have XML file where some symbols were incorrectly encoded because of mixing UTF-16 and UTF-8.
For example, 📞 symbol is encoded as �� (��) instead of 📞 (📞).
I want ...
-1
votes
3
answers
466
views
Converting input hex 0A to \n escaped character
I am using webpage to get data in hex to write serial modbus using python
Issue is that 0A in the string gets converted to \n.
How to stop this from happening?
rList = r'0106000600000AE9CC'
arr=str(...
1
vote
0
answers
355
views
Issue with HTML character escaping in JAVA spring boot deployed on weblogic server. It works in TEST environment but not in PRODUCTION
In my spring boot application I have below code which has AnnotationConfigWebApplicationContext and i included FrameworkWebconfig class (from jar file) in that AnnotationConfigWebApplicationContext ...
0
votes
3
answers
151
views
How to write exactly <h2> in html? [duplicate]
I would like to know how to write EXACTLY <h2> in HTML? Because every time I write <h2> in HTML it acts as an element. But I want <h2> as it is on my website.
0
votes
1
answer
325
views
How to not escape characters in Django Rest Framework
I have a blog model. I have text field where I want to write in HTML, for example including an a tag. The permission class used on unsafe methods is isAdminUser. I don't necessarily have to escape the ...
1
vote
0
answers
247
views
Add or update an attribute in a tag using Beautiful Soup python
given the code below:
html_code = '<table id="definition-table"><tbody><tr><td>' \
'<p><b><i><span class="lang">*...
-2
votes
1
answer
118
views
How to convert html attribute code to string
I have this js code:
var my_elem = document.querySelector("[action='/cart/add']");
but I need to make it a string, so I can use it as a string variable.
How I can do that?
I already tried:
'...
1
vote
1
answer
176
views
escape template in range
I want to print user list like: <@user1> <@user2>, this is an internal format in my company internal, but the golang template always escape the < to <. My code:
tpl, _ := ...
0
votes
1
answer
35
views
HTML redraw with ajax issue in PHP project
I'm working on a PHP assignment and having trouble getting an ajax call to properly redraw. Everything almost works except I have this one line of code that keeps giving me errors:
$line .= '<input ...
2
votes
0
answers
47
views
Unexpected Output through \r carriage return
var t2 = "\tMohamed\rMazen \n \tof \rMastering\n\t\t\programming";
console.log(t2);
The output using JavaScript is:
Mohamed
Mazen
of
Mastering
programming
Shouldn't it be:
...
0
votes
0
answers
218
views
Is there any way to check that texts escaped or not on a Chrome browser Developer tools?
I wondered if there is a way to check texts escaped or not.
"Edit as HTML" of "Element tab" appeared by a right-click does not seem to meet my request.
That means quotations are ...
0
votes
2
answers
92
views
HTTP response 403. Is the problem with my Apache config or my Python enoding of the URL?
When I access
http://my_site.com/api/my_project/submitSearch.php?skills=C+OR+%28C%2B%2B+AND+UML%29
I get an HTTP response of 403.
The point being that I am encoding skill=C OR (C++ AND UML) in Python ...
0
votes
2
answers
1k
views
Flutter/Dart json encode passwords with special characters
I am new to programming and aworking with Flutter. I am trying to login to an API using a post request.
The Model (used app.quicktype.io)
import 'dart:convert';
class UserLogin {
UserLogin({
...
0
votes
2
answers
87
views
How can I replace replace \" with '
I have the following content:
{
"z":"[{\"ItemId\":\"1234\",\"a\":\"1234\",\"b\":\"4567\",\"c\":\"d\"}]&...
0
votes
1
answer
35
views
How to remove "<" from value in xml
In my xml there are such xml tags:
<field><</field>
I need to replace the "<" character with blank.
I tried this statement but it prompts an error.
<xsl:value-of ...
1
vote
1
answer
72
views
Replace substring with <tag>substring</tag> in BeautifulSoup
I'm trying to modify an existing html file so that specific keywords are printed as strong (no matter where they appear).
My attempt:
from bs4 import BeautifulSoup as soup
txt = """<...
-1
votes
1
answer
156
views
How to escape script tag within iframe src?
I'm trying to inject javascript file via iframe tag as so -
myElement.insertAdjacentHTML('beforeend', '<iframe class="x" style="y" src="javascript: \'<script src=\'/path/...
0
votes
2
answers
149
views
Escaped html is again unescaped in jquery html method
I want to escape a title text in a div. But when feeding the escaped text into html() call, its again un-escaping it. Here is the code
const title = $('<div/>').text('test <script>').html()...
1
vote
1
answer
1k
views
Should i sanitize user inputs in express js?
I used express-validator escape() to sanitize user inputs and saved escaped data in database using parameterized query. When i render the input from database using EJS view engine i get escaped ...
1
vote
1
answer
199
views
Percentage sign getting removed when URI decoding
I'm trying to decode a uriencoded bit of form data in Perl (the encoded data is %25admin which should decode to %admin). I'm using some long repeated, simple regex to do it:
$value =~ tr/+/ /;
...
0
votes
0
answers
109
views
® symbol not being parsed in JSON-LD. Backslash(/) doesn't work
So I'm currently uploading a website schema and it has thrown up some parsing errors in a string. The ® symbol is showing up as shown below. However, adding a backslash does not seem to work and is ...
0
votes
0
answers
121
views
Escape <script> tag in PHP search function breaks CSS of website
I have the following input on my search.php:
<input type="text" id="inputboxSearch" name="q" value="<?php if(isset($_GET["q"])){echo htmlspecialchars($_GET["q"], ENT_QUOTES, 'UTF-8');} ?>"
...
0
votes
1
answer
317
views
How to escape "/" character in Google Script
I'm trying to bring Wordpress data to Google Sheets.
The script below worked for almost all columns but I can't bring the emails and if I try to scape the "-" my script won't run.
function getPage(...
1
vote
1
answer
105
views
What malicious things can a user do in an <img> src attribute?
I'm working on an application where users can provide a url to be used as the src in an <img> element.
What kind of things do I need to look out for to make sure a malicious user can't exploit ...
0
votes
0
answers
112
views
Flask template filter to exclude certain commands
Hello i have something like this for a flask app:
@app.route('/test')
def test():
user={'name':"{{session.username}}",'secret':"KEY{USE_ESCAPE_STRING!}"}
if request.args.get('name'):
...
0
votes
1
answer
274
views
PHP Codeigniter bypass html_scape function
I am running a php codeigniter app, and I need to bypass the html_escape function to insert embeded html code into the database.
This is an example of what I need to insert into the DB:
<script ...