-
Notifications
You must be signed in to change notification settings - Fork 47
/
html-escape-unescape.html
205 lines (192 loc) · 7.73 KB
/
html-escape-unescape.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
---
title: HTML Escape | UnEscape Online | Developer Tools
layout: post
---
<html>
<head>
{% include common-meta %}
<title>{{ page.title }}</title>
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<meta name="description" content="This is open source tool for programmers to escape or unescape a String value for HTML use." />
<meta name="keywords" content="online,tool,html,escape,unescape,encode,decode,web,opensource,http" />
<!-- CSS for the site theme -->
{% include theme-css %}
<!-- Annoying IE fixes -->
{% include ie-fixes %}
</head>
<body class="hold-transition skin-green sidebar-mini">
<!-- Site wrapper -->
<div class="wrapper">
<!-- header tag from theme -->
{% include theme-header %}
<!-- Sidebar for the whole website -->
{% include theme-sidebar %}
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Main content -->
<section class="content">
<div class="box box-info">
<div class="box-header with-border">
<h1 class="box-title">HTML Escape and UnEscape</h1>
</div>
<!-- /.box-header -->
<!-- form start -->
<div class="box-body">
<form role="form">
<div class="form-group">
<textarea class="form-control" rows="20" placeholder="Copy/Paste text here to escape or unescape" id="inputText" autofocus></textarea>
</div>
</form>
</div>
<!-- /.box-body -->
<div class="box-footer">
<div class="btn-group">
<button type="button" class="btn btn-success" id="escape"> Escape </button>
</div>
<div class="btn-group">
<button type="button" class="btn btn-info" id="unescape">UnEscape</button>
</div>
</div>
<!-- /.box-footer -->
</div>
</section>
<section class="content">
<div class="box box-info">
<div class="box-header with-border">
<h3 class="box-title">About HTML Escape and UnEscape Tool</h3>
</div>
<!-- /.box-header -->
<div class="box-body">
<p>This is a free online tool to escape and unescape HTML markup. You can copy/paste your desired HTML in below text field and hit Escape or UnEscape button.</p>
</div>
<!-- /.box-body -->
</div>
<div class="box box-info">
<div class="box-header with-border">
<h3 class="box-title">What is HTML Escaping?</h3>
</div>
<!-- /.box-header -->
<div class="box-body">
<p>HTML escaping is used to represent special meaning characters in a HTML code. e.g. less than symbol <code><</code> has a special meaning in HTML markup language. But in case your data contains a less than symbol <code><</code> and you
want to send it without confusing the browser then you need to send it as &lt; instead of <code><</code> . Simlarly there are many other special characters that can be used as part of HTML markup. Below sample list can give you a idea
of what this means.</p>
<p>This tool can easily encode a string to HTML entities or reverse the encoding and convert it to plain text string. </p>
</div>
<!-- /.box-body -->
</div>
<div class="box box-info">
<div class="box-header">
<h3 class="box-title">HTML Escaping Characters</h3>
</div>
<!-- /.box-header -->
<div class="box-body table-responsive no-padding">
<table class="table table-hover">
<tbody>
<tr>
<th>Character</th>
<th>HTML Escape Value</th>
</tr>
<tr>
<td>quote (")</td>
<td>&quot;</td>
</tr>
<tr>
<td>amphersand (&)</td>
<td>&amp;</td>
</tr>
<tr>
<td>less than symbol (<)</td>
<td>&lt;</td>
</tr>
<tr>
<td>greater than symbol (>)</td>
<td>&gt;</td>
</tr>
</tbody>
</table>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
<div class="box box-info">
<div class="box-header with-border">
<h3 class="box-title">Want To Know What Is The HTML Escaped Value of a Character?</h3>
</div>
<!-- /.box-header -->
<div class="box-body">
<p>That is easy. Just type the character or a full string in the text box above and hit Escape button. You should be able to see the escaped value.</p>
</div>
<!-- /.box-body -->
</div>
<div class="box box-info">
<div class="box-header with-border">
<h3 class="box-title">What is HTML UnEscaping?</h3>
</div>
<!-- /.box-header -->
<div class="box-body">
<p>HTML UnEscaping is the reverse process of escaping. This is used by the browser and client side programming languages to get the real data value from escaped string.</p>
</div>
<!-- /.box-body -->
</div>
<div class="box box-info">
<div class="box-header with-border">
<h3 class="box-title">What Characters Need To Be Escaped?</h3>
</div>
<!-- /.box-header -->
<div class="box-body">
<p>Only few special meaning character need to be escaped. These characters have special use in HTML markup language. </p>
</div>
<!-- /.box-body -->
</div>
<div class="box box-info">
<div class="box-header with-border">
<h3 class="box-title">Why HTML String Encoding Tool Is Needed?</h3>
</div>
<!-- /.box-header -->
<div class="box-body">
<p> <img class="img-responsive" src="images/html-escape.png" alt="HTML online string escape unescape tool" title="HTML online string escape unescape tool">
</p>
<p>This tool can be really handy for bloggers and web masters to display HTML code on their website. A website for HTML tutorials will require HTML encoding to display the actual HTML code instead of its browser rendered values. Most of the syntax
highlighter do this on the fly. However, you can use this tool to do encoding for static code snippets and more. </p>
</div>
<!-- /.box-body -->
</div>
</section>
{% include addthis %}
</div>
<!-- /.content-wrapper -->
{% include theme-footer %}
</div>
<!-- ./wrapper -->
{% include theme-bottom-js %}
</body>
<script src="plugins/selectOnFocus/jquery.selectOnFocus.min.js"></script>
<script>
var escapeIt = function(txt) {
return $("<div>").text(txt).html();
};
var unescapeIt = function(txt) {
var unescaped = $("<textarea/>").html(txt).text();
if (escapeIt(unescaped) == txt) {
return unescaped;
} else {
return txt;
}
};
$(document).ready(function() {
$("#escape").click(function() {
var resultTextArea = $("#inputText");
var txt = resultTextArea.val();
resultTextArea.val(escapeIt(txt));
});
$("#unescape").click(function() {
var resultTextArea = $("#inputText");
var txt = resultTextArea.val();
resultTextArea.val(unescapeIt(txt));
});
$("#inputText").selectOnFocus();
$('#string-utility-category').addClass('active');
});
</script>
</html>