author | Jan Vrany <jan.vrany@labware.com> |
Wed, 30 Jun 2021 14:07:56 +0100 | |
branch | jv |
changeset 5481 | 19d6355dc3e1 |
parent 4937 | b1402d9b1f39 |
permissions | -rw-r--r-- |
4769
89914ccfcf7d
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
4287
diff
changeset
|
1 |
"{ Encoding: utf8 }" |
89914ccfcf7d
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
4287
diff
changeset
|
2 |
|
2058 | 3 |
" |
4 |
COPYRIGHT (c) 2007 by eXept Software AG |
|
5 |
All Rights Reserved |
|
6 |
||
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
14 |
"{ Package: 'stx:libbasic2' }" |
|
15 |
||
3544 | 16 |
"{ NameSpace: Smalltalk }" |
17 |
||
2058 | 18 |
Object subclass:#HTMLUtilities |
19 |
instanceVariableNames:'' |
|
4937
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
20 |
classVariableNames:'AmpersandEscapes EscapeControlCharacters HtmlEntityToCharacter |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
21 |
MathAmpersandEscapes' |
2058 | 22 |
poolDictionaries:'' |
23 |
category:'Net-Communication-Support' |
|
24 |
! |
|
25 |
||
26 |
!HTMLUtilities class methodsFor:'documentation'! |
|
27 |
||
28 |
copyright |
|
29 |
" |
|
30 |
COPYRIGHT (c) 2007 by eXept Software AG |
|
31 |
All Rights Reserved |
|
32 |
||
33 |
This software is furnished under a license and may be used |
|
34 |
only in accordance with the terms of that license and with the |
|
35 |
inclusion of the above copyright notice. This software may not |
|
36 |
be provided or otherwise made available to, or used by, any |
|
37 |
other person. No title to or ownership of the software is |
|
38 |
hereby transferred. |
|
39 |
" |
|
40 |
! |
|
41 |
||
42 |
documentation |
|
43 |
" |
|
44 |
Collected support functions to deal with HTML. |
|
45 |
Used both by HTML generators (DocGenerator), HTMLParsers and the webServer. |
|
46 |
Therefore, it has been put into libbasic2. |
|
47 |
" |
|
48 |
! ! |
|
49 |
||
2442 | 50 |
!HTMLUtilities class methodsFor:'common actions'! |
51 |
||
52 |
openLauncherOnDisplay:displayName |
|
2458 | 53 |
<resource: #obsolete> |
2442 | 54 |
|
2458 | 55 |
"obsolete - do not use" |
2442 | 56 |
|
2458 | 57 |
self obsoleteMethodWarning. |
58 |
Error handle:[:ex | |
|
59 |
^ ex description |
|
60 |
] do:[ |
|
61 |
NewLauncher openLauncherOnInitializedDisplayNamed:displayName |
|
62 |
] |
|
2442 | 63 |
|
2458 | 64 |
"Modified: / 01-06-2010 / 11:25:12 / sr" |
2442 | 65 |
! ! |
66 |
||
4937
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
67 |
!HTMLUtilities class methodsFor:'constants'! |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
68 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
69 |
ampersandEscapes |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
70 |
AmpersandEscapes isNil ifTrue:[ |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
71 |
AmpersandEscapes := IdentityDictionary new. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
72 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
73 |
#( |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
74 |
#nbsp 160 "/ non-breakable space - do something magic... |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
75 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
76 |
#emspace 160 "/ temporary |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
77 |
#enspace 160 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
78 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
79 |
#lt $< |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
80 |
#gt $> |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
81 |
#amp $& |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
82 |
#quot $" |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
83 |
#apos $' |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
84 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
85 |
#copy 169 "/ copyright |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
86 |
#reg 174 "/ registered |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
87 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
88 |
#cent 162 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
89 |
#pound 163 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
90 |
#yen 165 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
91 |
#brvbar $| |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
92 |
#sect 167 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
93 |
#laquo 171 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
94 |
#raquo 187 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
95 |
#plusmn 177 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
96 |
#micro 181 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
97 |
#middot 183 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
98 |
#frac14 188 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
99 |
#frac12 189 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
100 |
#frac34 190 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
101 |
#iquest 191 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
102 |
#iexcl 16rA1 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
103 |
#div 247 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
104 |
#divide 247 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
105 |
#not 16rAC |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
106 |
#shy 16rAD |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
107 |
#para 16rB6 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
108 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
109 |
#deg 176 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
110 |
#sup1 185 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
111 |
#sup2 178 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
112 |
#sup3 179 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
113 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
114 |
#ordm 16rBA |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
115 |
#ordf 16rAA |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
116 |
#macr 16rAF |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
117 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
118 |
#cedil 16rB8 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
119 |
#uml 16rA8 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
120 |
#acute 16rB4 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
121 |
#curren 16rA4 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
122 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
123 |
#Oslash 216 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
124 |
#oslash 248 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
125 |
#aring 229 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
126 |
#Aring 197 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
127 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
128 |
#ccedil 231 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
129 |
#Ccedil 199 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
130 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
131 |
#thorn 16rFE |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
132 |
#THORN 16rDE |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
133 |
#Thorn 15rDE |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
134 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
135 |
#eth 16rF0 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
136 |
#ETH 16rD0 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
137 |
#Eth 16rD0 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
138 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
139 |
#atilde 227 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
140 |
#Atilde 195 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
141 |
#ntilde 241 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
142 |
#Ntilde 209 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
143 |
#otilde 245 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
144 |
#Otilde 213 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
145 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
146 |
#auml 228 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
147 |
#Auml 196 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
148 |
#uuml 252 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
149 |
#Uuml 220 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
150 |
#ouml 246 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
151 |
#Ouml 214 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
152 |
#euml 235 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
153 |
#Euml 203 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
154 |
#iuml 239 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
155 |
#Iuml 207 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
156 |
#yuml 255 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
157 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
158 |
#acirc 226 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
159 |
#Acirc 194 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
160 |
#icirc 238 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
161 |
#Icirc 206 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
162 |
#ecirc 234 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
163 |
#Ecirc 202 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
164 |
#ucirc 251 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
165 |
#Ucirc 219 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
166 |
#ocirc 244 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
167 |
#Ocirc 212 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
168 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
169 |
#agrave 224 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
170 |
#Agrave 192 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
171 |
#egrave 232 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
172 |
#Egrave 200 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
173 |
#igrave 236 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
174 |
#Igrave 204 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
175 |
#ograve 242 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
176 |
#Ograve 210 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
177 |
#ugrave 249 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
178 |
#Ugrave 217 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
179 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
180 |
#aacute 225 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
181 |
#Aacute 193 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
182 |
#eacute 233 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
183 |
#Eacute 201 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
184 |
#iacute 237 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
185 |
#Iacute 205 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
186 |
#oacute 243 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
187 |
#Oacute 211 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
188 |
#uacute 250 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
189 |
#Uacute 218 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
190 |
#yacute 16rFD |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
191 |
#Yacute 16rDD |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
192 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
193 |
#szlig 223 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
194 |
#aelig 230 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
195 |
#AElig 198 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
196 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
197 |
"/ unicode |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
198 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
199 |
#OElig 16r0152 "/ 8859-2 (latin2) |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
200 |
#oelig 16r0153 "/ 8859-2 (latin2) |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
201 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
202 |
#ljlig 16r01C9 "/ 8859-2 (latin2) |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
203 |
#LJlig 16r01C7 "/ 8859-2 (latin2) |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
204 |
#Ljlig 16r01C8 "/ 8859-2 (latin2) |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
205 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
206 |
#Scaron 16r0160 "/ 8859-2 (latin2) |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
207 |
#scaron 16r0161 "/ 8859-2 (latin2) |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
208 |
#Yuml 16r0178 "/ 8859-2 (latin2) |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
209 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
210 |
#Alpha 16r0391 "/ greek alpha |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
211 |
#Beta 16r0392 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
212 |
#Gamma 16r0393 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
213 |
#Delta 16r0394 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
214 |
#Epsilon 16r0395 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
215 |
#Zeta 16r0396 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
216 |
#Eta 16r0397 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
217 |
#Theta 16r0398 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
218 |
#Iota 16r0399 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
219 |
#Kappa 16r039A |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
220 |
#Lambda 16r039B |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
221 |
#Mu 16r039C |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
222 |
#Nu 16r039D |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
223 |
#Xi 16r039E |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
224 |
#Omicron 16r039F |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
225 |
#Pi 16r03A0 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
226 |
#Rho 16r03A1 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
227 |
#Sigma 16r03A3 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
228 |
#Tau 16r03A4 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
229 |
#Upsilon 16r03A5 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
230 |
#Phi 16r03A6 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
231 |
#Chi 16r03A7 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
232 |
#Psi 16r03A8 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
233 |
#Omega 16r03A9 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
234 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
235 |
#alpha 16r03B1 "/ greek alpha |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
236 |
#beta 16r03B2 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
237 |
#gamma 16r03B3 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
238 |
#delta 16r03B4 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
239 |
#epsilon 16r03B5 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
240 |
#zeta 16r03B6 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
241 |
#eta 16r03B7 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
242 |
#theta 16r03B8 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
243 |
#iota 16r03B9 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
244 |
#kappa 16r03BA |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
245 |
#lambda 16r03BB |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
246 |
#mu 16r03BC |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
247 |
#nu 16r03BD |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
248 |
#xi 16r03BE |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
249 |
#omicron 16r03BF |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
250 |
#pi 16r03C0 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
251 |
#rho 16r03C1 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
252 |
#sigmaf 16r03C2 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
253 |
#sigma 16r03C3 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
254 |
#tau 16r03C4 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
255 |
#upsilon 16r03C5 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
256 |
#phi 16r03C6 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
257 |
#chi 16r03C7 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
258 |
#psi 16r03C8 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
259 |
#omega 16r03C9 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
260 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
261 |
#thetasym 16r03D1 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
262 |
#upsih 16r03D2 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
263 |
#piv 16r03D6 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
264 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
265 |
#ensp 16r2002 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
266 |
#emsp 16r2003 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
267 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
268 |
#thinsp 16r2009 "/ thin space |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
269 |
#zwnj 16r200C "/ zero width non-joiner |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
270 |
#zwj 16r200D "/ zero width joiner |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
271 |
#lrm 16r200E "/ left-to-right mark |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
272 |
#rlm 16r200F "/ right-to-left mark |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
273 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
274 |
#ndash 16r2013 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
275 |
#mdash 16r2014 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
276 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
277 |
#lsquo 16r2018 "/ left single quot. mark |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
278 |
#rsquo 16r2019 "/ right single quot. mark |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
279 |
#sbquo 16r201A "/ single low-9 quot. mark |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
280 |
#ldquo 16r201C "/ left double quot. mark |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
281 |
#rdquo 16r201D "/ right double quot. mark |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
282 |
#bdquo 16r201E "/ double low-9 quot. mark |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
283 |
#dagger 16r2020 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
284 |
#Dagger 16r2021 "/ double dagger |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
285 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
286 |
#bull 16r2022 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
287 |
#hellip 16r2026 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
288 |
#prime 16r2032 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
289 |
#Prime 16r2033 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
290 |
#oline 16r203E |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
291 |
#frasl 16r2044 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
292 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
293 |
#euro 16r20AC "/ 8859-16 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
294 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
295 |
#weierp 16r2118 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
296 |
#image 16r2111 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
297 |
#real 16r211C |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
298 |
#trade 16r2122 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
299 |
#angst 16r212B |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
300 |
#alefsym 16r2135 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
301 |
#larr 16r2190 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
302 |
#uarr 16r2191 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
303 |
#rarr 16r2192 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
304 |
#darr 16r2193 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
305 |
#harr 16r2194 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
306 |
#crarr 16r21B5 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
307 |
#lArr 16r21D0 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
308 |
#uArr 16r21D1 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
309 |
#rArr 16r21D2 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
310 |
#dArr 16r21D3 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
311 |
#hArr 16r21D4 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
312 |
#forall 16r2200 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
313 |
#part 16r2202 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
314 |
#exist 16r2203 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
315 |
#empty 16r2205 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
316 |
#nabla 16r2207 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
317 |
#isin 16r2208 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
318 |
#notin 16r2209 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
319 |
#ni 16r220B |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
320 |
#prod 16r220F |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
321 |
#sum 16r2211 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
322 |
#minus 16r2212 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
323 |
#lowast 16r2217 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
324 |
#radic 16r221A |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
325 |
#prop 16r221D |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
326 |
#infin 16r221E |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
327 |
#ang90 16r221F |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
328 |
#ang 16r2220 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
329 |
#angmsd 16r2221 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
330 |
#angsph 16r2222 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
331 |
#and 16r2227 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
332 |
#or 16r2228 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
333 |
#cap 16r2229 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
334 |
#cup 16r222A |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
335 |
#int 16r222B |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
336 |
#there4 16r2234 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
337 |
#sim 16r223C |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
338 |
#cong 16r2245 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
339 |
#asymp 16r2248 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
340 |
#ne 16r2260 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
341 |
#equiv 16r2261 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
342 |
#le 16r2264 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
343 |
#ge 16r2265 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
344 |
#sub 16r2282 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
345 |
#sup 16r2283 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
346 |
#nsub 16r2284 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
347 |
#sube 16r2286 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
348 |
#supe 16r2287 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
349 |
#oplus 16r2295 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
350 |
#otimes 16r2297 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
351 |
#perp 16r22A5 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
352 |
#sdot 16r22C5 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
353 |
#lceil 16r2308 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
354 |
#rceil 16r2309 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
355 |
#lfloor 16r230A |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
356 |
#rfloor 16r230B |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
357 |
#lang 16r2329 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
358 |
#rang 16r232A |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
359 |
#loz 16r25CA |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
360 |
#spades 16r2660 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
361 |
#clubs 16r2663 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
362 |
#hearts 16r2665 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
363 |
#diams 16r2666 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
364 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
365 |
) pairWiseDo:[:key :val | |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
366 |
|v| |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
367 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
368 |
v := val. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
369 |
val isInteger ifTrue:[ |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
370 |
v := Character value:v |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
371 |
]. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
372 |
AmpersandEscapes at:key put:v |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
373 |
]. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
374 |
]. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
375 |
^ AmpersandEscapes |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
376 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
377 |
"Created: / 01-04-2019 / 14:34:25 / Claus Gittinger" |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
378 |
! |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
379 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
380 |
htmlEntityToCharacter |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
381 |
^ self ampersandEscapes |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
382 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
383 |
"Modified: / 01-04-2019 / 14:36:41 / Claus Gittinger" |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
384 |
! |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
385 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
386 |
mathAmpersandEscapes |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
387 |
"these are obsolete now, as HTML4 added the missing stuff in the meantime." |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
388 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
389 |
MathAmpersandEscapes isNil ifTrue:[ |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
390 |
MathAmpersandEscapes := IdentityDictionary new. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
391 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
392 |
#( |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
393 |
"/ #alpha 16r61 "/ greek alpha |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
394 |
"/ #beta 16r62 "/ greek beta |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
395 |
"/ #chi 16r63 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
396 |
"/ #delta 16r64 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
397 |
"/ #epsilon 16r65 "/ symbol characterSet has no epsilon |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
398 |
#vepsilon 16r65 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
399 |
"/ #phi 16r66 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
400 |
"/ #gamma 16r67 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
401 |
"/ #eta 16r68 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
402 |
"/ #iota 16r69 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
403 |
#varphi 16r6A |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
404 |
"/ #kappa 16r6B |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
405 |
"/ #lambda 16r6C |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
406 |
"/ #mu 16r6D |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
407 |
"/ #nu 16r6E |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
408 |
"/ #omicron 16r6F |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
409 |
"/ #pi 16r70 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
410 |
"/ #theta 16r71 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
411 |
#vtheta 16r71 "/ symbol characterSet has no vtheta |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
412 |
"/ #rho 16r72 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
413 |
#varrho 16r72 "/ symbol characterSet has no varrho |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
414 |
"/ #sigma 16r73 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
415 |
#vsigma 16r56 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
416 |
"/ #tau 16r74 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
417 |
"/ #upsilon 16r75 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
418 |
#varpi 16r76 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
419 |
"/ #omega 16r77 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
420 |
"/ #xi 16r78 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
421 |
"/ #psi 16r79 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
422 |
"/ #zeta 16r7A |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
423 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
424 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
425 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
426 |
"/ #Alpha 16r41 "/ greek alpha |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
427 |
"/ #Beta 16r42 "/ greek beta |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
428 |
"/ #Chi 16r43 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
429 |
"/ #Delta 16r44 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
430 |
"/ #Epsilon 16r45 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
431 |
"/ #Phi 16r46 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
432 |
"/ #Gamma 16r47 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
433 |
"/ #Eta 16r48 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
434 |
"/ #Iota 16r49 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
435 |
"/ |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
436 |
"/ #Kappa 16r4B |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
437 |
"/ #Lambda 16r4C |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
438 |
"/ #Mu 16r4D |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
439 |
"/ #Nu 16r4E |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
440 |
"/ #Omicron 16r4F |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
441 |
"/ #Pi 16r50 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
442 |
"/ #Theta 16r51 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
443 |
"/ #Rho 16r52 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
444 |
"/ #Sigma 16r53 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
445 |
"/ #Tau 16r54 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
446 |
"/ #Upsilon 16rA1 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
447 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
448 |
"/ #Omega 16r57 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
449 |
"/ #Xi 16r58 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
450 |
"/ #Psi 16r59 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
451 |
"/ #Zeta 16r5A |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
452 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
453 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
454 |
"/ #forall 16r22 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
455 |
#exist 16r24 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
456 |
#exists 16r24 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
457 |
#aleph 16rC0 "/ no, this is not alf ;-) |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
458 |
#Re 16rC2 "/ R fraktur |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
459 |
#Im 16rC1 "/ I fraktur |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
460 |
#infty 16rA5 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
461 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
462 |
#leq 16rA3 "/ less-equal |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
463 |
#geq 16rB3 "/ greater-equal |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
464 |
#equiv 16rBA "/ equivalent |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
465 |
#approx 16rBB |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
466 |
#cong 16r40 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
467 |
"/ #neq 16rB9 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
468 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
469 |
"/ #plusmn 16rB1 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
470 |
#times 16rB4 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
471 |
"/ #div 16rB8 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
472 |
#oplus 16rC5 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
473 |
#otimes 16rC4 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
474 |
#oslash 16rC5 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
475 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
476 |
#sum 16rE5 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
477 |
#prod 16rD5 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
478 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
479 |
#uparrow 16rAD |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
480 |
#leftarrow 16rAC |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
481 |
#downarrow 16rAF |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
482 |
#rightarrow 16rAE |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
483 |
#leftrightarrow 16rAB |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
484 |
#Uparrow 16rDD |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
485 |
#Leftarrow 16rDC |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
486 |
#Downarrow 16rDF |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
487 |
#Rightarrow 16rDE |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
488 |
#Leftrightarrow 16rDB |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
489 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
490 |
#supset 16rC9 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
491 |
#supseteq 16rCA |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
492 |
#subset 16rCC |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
493 |
#subseteq 16rCD |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
494 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
495 |
#vee 16rDA |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
496 |
#wedge 16rD9 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
497 |
#neg 16rD8 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
498 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
499 |
#ldots 16rBC |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
500 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
501 |
"/ #lfloor 16rEB |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
502 |
"/ #rfloor 16rFB |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
503 |
"/ #lceil 16rE9 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
504 |
"/ #rceil 16rF9 |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
505 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
506 |
) pairWiseDo:[:key :val | |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
507 |
|v| |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
508 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
509 |
v := val. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
510 |
val isInteger ifTrue:[ |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
511 |
v := Character value:v |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
512 |
]. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
513 |
MathAmpersandEscapes at:key put:v |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
514 |
]. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
515 |
]. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
516 |
^ MathAmpersandEscapes |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
517 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
518 |
"Created: / 01-04-2019 / 14:40:51 / Claus Gittinger" |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
519 |
! ! |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
520 |
|
2058 | 521 |
!HTMLUtilities class methodsFor:'helpers'! |
522 |
||
3557 | 523 |
characterFromHtmlEntityNamed:anHtmlEntityName |
4937
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
524 |
^ self ampersandEscapes |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
525 |
at:anHtmlEntityName asSymbol |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
526 |
ifAbsent:[ |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
527 |
self halt. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
528 |
"/ where to get the mapping??? |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
529 |
"/ Answer: It is a mess. A good start may be |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
530 |
"/ https://www.w3.org/TR/html4/sgml/entities.html with 252 named entities. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
531 |
"/ I guess an actual lookup table would be adequate. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
532 |
$~ |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
533 |
] |
3557 | 534 |
|
4937
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
535 |
"Modified: / 01-04-2019 / 14:36:18 / Claus Gittinger" |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
536 |
"Modified: / 04-04-2019 / 10:46:22 / Maren" |
3557 | 537 |
! |
538 |
||
2058 | 539 |
controlCharacters |
540 |
||
541 |
EscapeControlCharacters isNil ifTrue:[ |
|
542 |
EscapeControlCharacters := Dictionary new. |
|
543 |
EscapeControlCharacters at:$< put:'<'. |
|
544 |
EscapeControlCharacters at:$> put:'>'. |
|
545 |
EscapeControlCharacters at:$& put:'&'. |
|
546 |
EscapeControlCharacters at:$" put:'"'. |
|
2436
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
547 |
"/ EscapeControlCharacters at:$' put:'''. |
2058 | 548 |
]. |
549 |
^ EscapeControlCharacters. |
|
3544 | 550 |
|
551 |
"Modified (comment): / 06-05-2015 / 16:17:31 / sr" |
|
2058 | 552 |
! |
553 |
||
4937
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
554 |
copyReplaceCharactersWithHtmlEntitiesIn:aString |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
555 |
|stream htmlEntity| |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
556 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
557 |
stream := '' writeStream. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
558 |
(aString ? '') do:[:eachCharacter | |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
559 |
htmlEntity := self htmlEntityForCharacter:eachCharacter. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
560 |
htmlEntity isNil ifTrue:[ |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
561 |
stream nextPut:eachCharacter. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
562 |
] ifFalse:[ |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
563 |
stream |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
564 |
nextPut:$&; |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
565 |
nextPutAll:htmlEntity; |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
566 |
nextPut:$;. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
567 |
]. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
568 |
]. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
569 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
570 |
^ stream contents |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
571 |
! |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
572 |
|
2058 | 573 |
escapeCharacterEntities:aString |
574 |
"helper to escape invalid/dangerous characters in html strings. |
|
575 |
These are: |
|
576 |
control characters, '<', '>', '&' and space -> %XX ascii as hex digits |
|
577 |
% -> %% |
|
578 |
" |
|
2066 | 579 |
"/ TODO: this is similar to withSpecialHTMLCharactersEscaped. |
580 |
"/ we should refactor this into one method only (can we do hex escapes always ?). |
|
581 |
"/ Notice, that these two methods came into existance due to historic reasons |
|
582 |
"/ and were developed independent of each other, but later moved to this common place. |
|
583 |
||
584 |
||
3545 | 585 |
^self escapeCharacterEntities:aString andControlCharacters:self controlCharacters |
586 |
||
587 |
" |
|
588 |
self escapeCharacterEntities:'a<b' |
|
4769
89914ccfcf7d
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
4287
diff
changeset
|
589 |
self escapeCharacterEntities:'aöb' |
3545 | 590 |
" |
591 |
||
592 |
"Modified: / 06-05-2015 / 16:30:13 / sr" |
|
593 |
! |
|
2058 | 594 |
|
3545 | 595 |
escapeCharacterEntities:aString andControlCharacters:controlCharacters |
596 |
"helper to escape invalid/dangerous characters in html strings. |
|
597 |
These are: |
|
598 |
control characters, '<', '>', '&' and space -> %XX ascii as hex digits |
|
599 |
% -> %% |
|
600 |
" |
|
601 |
"/ TODO: this is similar to withSpecialHTMLCharactersEscaped. |
|
602 |
"/ we should refactor this into one method only (can we do hex escapes always ?). |
|
603 |
"/ Notice, that these two methods came into existance due to historic reasons |
|
604 |
"/ and were developed independent of each other, but later moved to this common place. |
|
605 |
||
606 |
||
4937
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
607 |
^ String |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
608 |
streamContents:[:ws | |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
609 |
self escapeCharacterEntities:aString andControlCharacters:controlCharacters on:ws. |
2058 | 610 |
] |
611 |
||
612 |
" |
|
613 |
self escapeCharacterEntities:'a<b' |
|
4769
89914ccfcf7d
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
4287
diff
changeset
|
614 |
self escapeCharacterEntities:'aöb' |
2058 | 615 |
" |
3545 | 616 |
|
617 |
"Created: / 06-05-2015 / 16:29:51 / sr" |
|
4937
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
618 |
"Modified (format): / 05-02-2017 / 17:59:32 / cg" |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
619 |
! |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
620 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
621 |
escapeCharacterEntities:aString andControlCharacters:controlCharacters on:aWriteStream |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
622 |
"helper to escape invalid/dangerous characters in html strings. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
623 |
These are: |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
624 |
control characters, '<', '>', '&' and space -> %XX ascii as hex digits |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
625 |
% -> %% |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
626 |
" |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
627 |
"/ TODO: this is similar to withSpecialHTMLCharactersEscaped. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
628 |
"/ we should refactor this into one method only (can we do hex escapes always ?). |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
629 |
"/ Notice, that these two methods came into existance due to historic reasons |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
630 |
"/ and were developed independent of each other, but later moved to this common place. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
631 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
632 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
633 |
|rs c controlString| |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
634 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
635 |
rs := ReadStream on: aString. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
636 |
[ rs atEnd ] whileFalse: [ |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
637 |
c := rs next. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
638 |
controlString := controlCharacters notEmptyOrNil ifTrue:[controlCharacters at:c ifAbsent:nil] ifFalse:[nil]. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
639 |
controlString notNil ifTrue:[ |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
640 |
aWriteStream nextPutAll:controlString. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
641 |
] ifFalse:[ |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
642 |
c codePoint > 16r7F ifTrue:[ |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
643 |
aWriteStream nextPutAll:'&#'. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
644 |
c codePoint printOn:aWriteStream. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
645 |
aWriteStream nextPut:$;. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
646 |
] ifFalse:[ |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
647 |
aWriteStream nextPut:c. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
648 |
] |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
649 |
] |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
650 |
]. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
651 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
652 |
" |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
653 |
self escapeCharacterEntities:'a<b' |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
654 |
self escapeCharacterEntities:'aöb' |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
655 |
" |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
656 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
657 |
"Created: / 05-02-2017 / 17:58:34 / cg" |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
658 |
"Modified: / 17-02-2017 / 10:34:20 / stefan" |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
659 |
! |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
660 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
661 |
escapeCharacterEntities:aString on:aStream |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
662 |
"helper to escape invalid/dangerous characters in html strings. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
663 |
These are: |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
664 |
control characters, '<', '>', '&' and space -> %XX ascii as hex digits |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
665 |
% -> %% |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
666 |
" |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
667 |
"/ TODO: this is similar to withSpecialHTMLCharactersEscaped. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
668 |
"/ we should refactor this into one method only (can we do hex escapes always ?). |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
669 |
"/ Notice, that these two methods came into existance due to historic reasons |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
670 |
"/ and were developed independent of each other, but later moved to this common place. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
671 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
672 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
673 |
^self escapeCharacterEntities:aString andControlCharacters:self controlCharacters on:aStream |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
674 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
675 |
" |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
676 |
self escapeCharacterEntities:'a<b' |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
677 |
self escapeCharacterEntities:'aöb' |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
678 |
" |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
679 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
680 |
"Created: / 05-02-2017 / 18:00:56 / cg" |
2058 | 681 |
! |
682 |
||
683 |
extractCharSetEncodingFromContentType:contentTypeLine |
|
684 |
|idx rest encoding| |
|
685 |
||
686 |
idx := contentTypeLine findString:'charset='. |
|
687 |
idx == 0 ifTrue:[ |
|
688 |
^ nil |
|
689 |
]. |
|
690 |
rest := (contentTypeLine copyFrom:idx+'charset=' size) withoutSeparators. |
|
691 |
idx := (rest indexOfSeparator) min:(rest indexOf:$;). |
|
692 |
idx == 0 ifTrue:[ |
|
693 |
encoding := rest |
|
694 |
] ifFalse:[ |
|
695 |
encoding := rest copyTo:idx-1. |
|
696 |
]. |
|
697 |
(encoding startsWith:$") ifTrue:[ |
|
698 |
encoding := encoding copyFrom:2 to:(encoding indexOf:$" startingAt:3)-1. |
|
699 |
]. |
|
700 |
^ encoding. |
|
701 |
||
702 |
" |
|
703 |
self extractCharSetEncodingFromContentType:'text/html; charset=ascii' |
|
704 |
self extractCharSetEncodingFromContentType:'text/html; charset=' |
|
705 |
self extractCharSetEncodingFromContentType:'text/html; fooBar=bla' |
|
706 |
self extractCharSetEncodingFromContentType:'text/xml; charset=utf-8' |
|
707 |
self extractCharSetEncodingFromContentType:'text/xml; charset=utf-8; bla=fasel' |
|
708 |
" |
|
709 |
! |
|
710 |
||
711 |
extractMimeTypeFromContentType:contentTypeLine |
|
712 |
|idx mimeAndEncoding| |
|
713 |
||
714 |
idx := contentTypeLine indexOf:$:. |
|
715 |
mimeAndEncoding := (contentTypeLine copyFrom:idx+1) withoutSeparators. |
|
716 |
||
717 |
(mimeAndEncoding includes:$;) ifFalse:[ |
|
718 |
^ mimeAndEncoding |
|
719 |
]. |
|
720 |
||
721 |
idx := mimeAndEncoding indexOf:$;. |
|
722 |
^ mimeAndEncoding copyTo:idx-1 |
|
723 |
||
724 |
" |
|
725 |
self extractMimeTypeFromContentType:'text/html; charset=ascii' |
|
726 |
self extractMimeTypeFromContentType:'text/html; ' |
|
727 |
self extractMimeTypeFromContentType:'text/html' |
|
728 |
self extractMimeTypeFromContentType:'text/xml; charset=utf-8' |
|
729 |
" |
|
730 |
! |
|
731 |
||
4937
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
732 |
htmlEntityForCharacter:aCharacter |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
733 |
aCharacter == Character space ifTrue:[^ nil]. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
734 |
aCharacter isLetterOrDigit ifTrue:[^ nil]. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
735 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
736 |
^ self ampersandEscapes |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
737 |
keyAtValue:aCharacter |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
738 |
ifAbsent:nil |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
739 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
740 |
"Modified: / 01-04-2019 / 14:36:25 / Claus Gittinger" |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
741 |
! |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
742 |
|
2058 | 743 |
unEscape:aString |
2522 | 744 |
"Convert escaped characters in an urls arguments or post fields back to their proper characters. |
4937
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
745 |
Undoes the effect of #urlEncoded: and #urlEncoded2:. |
2058 | 746 |
These are: |
747 |
+ -> space |
|
748 |
%XX ascii as hex digits |
|
4937
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
749 |
%uXXXX unicode as hex digits NOTE: %u is non-standard bit implemented in MS IIS |
2058 | 750 |
%% -> % |
751 |
" |
|
752 |
||
3544 | 753 |
|rs ws c peekC isUnicodeEscaped| |
2058 | 754 |
|
4204 | 755 |
aString isNil ifTrue:[ |
756 |
^ nil. |
|
757 |
]. |
|
758 |
||
2522 | 759 |
(aString includesAny:'+%') ifFalse:[ |
2058 | 760 |
^ aString |
761 |
]. |
|
762 |
||
763 |
rs := ReadStream on: aString. |
|
3544 | 764 |
ws := CharacterWriteStream on: ''. |
765 |
isUnicodeEscaped := false. |
|
766 |
||
2058 | 767 |
[rs atEnd] whileFalse:[ |
768 |
c := rs next. |
|
3544 | 769 |
|
770 |
isUnicodeEscaped ifTrue:[ |
|
771 |
isUnicodeEscaped := false. |
|
772 |
c := (Integer readFrom:(rs nextAvailable:4) radix:16) asCharacter. |
|
773 |
] ifFalse:[ |
|
774 |
c == $+ ifTrue:[ |
|
775 |
c := Character space. |
|
776 |
] ifFalse:[ |
|
777 |
c == $% ifTrue:[ |
|
778 |
peekC := rs peek. |
|
779 |
(peekC notNil and:[peekC isHexDigit]) ifTrue:[ |
|
780 |
c := (Integer readFrom:(rs nextAvailable:2) radix:16) asCharacter. |
|
781 |
] ifFalse:[ |
|
782 |
(peekC notNil and:[peekC == $u]) ifTrue:[ |
|
783 |
isUnicodeEscaped := true. |
|
784 |
c := nil. |
|
2058 | 785 |
] ifFalse:[ |
786 |
c := rs next. |
|
3544 | 787 |
]. |
788 |
]. |
|
789 |
]. |
|
2058 | 790 |
]. |
3544 | 791 |
]. |
792 |
||
793 |
c notNil ifTrue:[ |
|
794 |
ws nextPut:c. |
|
795 |
]. |
|
2058 | 796 |
]. |
797 |
^ ws contents |
|
798 |
||
799 |
" |
|
2087 | 800 |
self unEscape:'a%20b' |
801 |
self unEscape:'a%%b' |
|
802 |
self unEscape:'a+b' |
|
803 |
self unEscape:'a%+b' |
|
2179
c1cee8bbc1e5
unescape: care for invalid escape sequence (%, %singleDigit atEnd)
sr
parents:
2144
diff
changeset
|
804 |
self unEscape:'a%' |
c1cee8bbc1e5
unescape: care for invalid escape sequence (%, %singleDigit atEnd)
sr
parents:
2144
diff
changeset
|
805 |
self unEscape:'a%2' |
4287 | 806 |
self unEscape:'/Home/a%C3%A4%C3%B6%C3%BCa' |
2058 | 807 |
" |
2179
c1cee8bbc1e5
unescape: care for invalid escape sequence (%, %singleDigit atEnd)
sr
parents:
2144
diff
changeset
|
808 |
|
2522 | 809 |
"Modified: / 09-01-2011 / 10:44:50 / cg" |
3544 | 810 |
"Modified (comment): / 06-05-2015 / 15:40:04 / sr" |
4937
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
811 |
"Modified (comment): / 03-02-2017 / 17:06:32 / stefan" |
2522 | 812 |
! |
813 |
||
3545 | 814 |
unescapeCharacterEntities:aString |
815 |
"helper to unescape character entities in a string. |
|
816 |
Normally, this is done by the HTMLParser when it scans text, |
|
817 |
but seems to be also used in post-data fields which contain non-ascii characters |
|
818 |
(for example: the login postdata of expeccALM). |
|
819 |
||
820 |
Sequences are: |
|
3557 | 821 |
&<specialName>; |
822 |
&#<decimal>; |
|
823 |
&#x<hex> |
|
824 |
||
825 |
From Reference: |
|
826 |
http://wiki.selfhtml.org/wiki/Referenz:HTML/Zeichenreferenz#HTML-eigene_Zeichen |
|
3545 | 827 |
" |
828 |
||
3557 | 829 |
|rs ws c |
830 |
entity entityNumberPart |
|
831 |
htmlEntityMatchingFailed characterFromHtmlEntity| |
|
3545 | 832 |
|
833 |
(aString includes:$&) ifFalse:[ |
|
834 |
^ aString |
|
835 |
]. |
|
836 |
||
3557 | 837 |
rs := ReadStream on:aString. |
838 |
ws := CharacterWriteStream on:''. |
|
3545 | 839 |
|
840 |
[rs atEnd] whileFalse:[ |
|
841 |
c := rs next. |
|
842 |
c == $& ifTrue:[ |
|
3557 | 843 |
entity := rs upToMatching:[:ch | ch == $;]. |
844 |
entity notEmpty ifTrue:[ |
|
845 |
rs peek == $; ifTrue:[ "/ something between & and ; |
|
846 |
rs next. "/ read over semicolon |
|
847 |
htmlEntityMatchingFailed := false. |
|
848 |
||
849 |
entity first == $# ifTrue:[ "/ entity is determined as number |
|
850 |
entityNumberPart := entity copyFrom:2. |
|
851 |
entityNumberPart notEmpty ifTrue:[ |
|
852 |
entityNumberPart first == $x ifTrue:[ |
|
853 |
entityNumberPart := entityNumberPart copyFrom:2. |
|
854 |
entityNumberPart notEmpty ifTrue:[ |
|
855 |
ws nextPut:(Character value:(Integer readFrom:entityNumberPart radix:16)). |
|
856 |
] ifFalse:[ |
|
857 |
htmlEntityMatchingFailed := true. |
|
858 |
]. |
|
3545 | 859 |
] ifFalse:[ |
3557 | 860 |
entityNumberPart isNumeric ifTrue:[ |
861 |
ws nextPut:(Character value:(Integer readFrom:entityNumberPart)). |
|
862 |
] ifFalse:[ |
|
863 |
htmlEntityMatchingFailed := true. |
|
864 |
]. |
|
3545 | 865 |
]. |
3557 | 866 |
] ifFalse:[ |
867 |
htmlEntityMatchingFailed := true. |
|
868 |
]. |
|
869 |
] ifFalse:[ |
|
870 |
characterFromHtmlEntity := self characterFromHtmlEntityNamed:entity. |
|
871 |
characterFromHtmlEntity notNil ifTrue:[ |
|
872 |
ws nextPut:characterFromHtmlEntity. |
|
873 |
] ifFalse:[ |
|
874 |
htmlEntityMatchingFailed := true. |
|
3545 | 875 |
]. |
3557 | 876 |
]. |
877 |
||
878 |
htmlEntityMatchingFailed ifTrue:[ |
|
879 |
ws nextPut:c. |
|
880 |
ws nextPutAll:entity. |
|
4937
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
881 |
ws nextPut:$;. |
3557 | 882 |
]. |
883 |
] ifFalse:[ |
|
884 |
ws nextPut:c. |
|
885 |
ws nextPutAll:entity. |
|
886 |
]. |
|
3545 | 887 |
] ifFalse:[ |
3557 | 888 |
ws nextPut:c. |
889 |
]. |
|
3545 | 890 |
] ifFalse:[ |
3557 | 891 |
ws nextPut:c. |
892 |
]. |
|
3545 | 893 |
]. |
3557 | 894 |
|
3545 | 895 |
^ ws contents |
896 |
||
897 |
" |
|
3557 | 898 |
self unescapeCharacterEntities:'&;' |
3545 | 899 |
self unescapeCharacterEntities:'&16368;' |
900 |
self unescapeCharacterEntities:'&16368;&16368' |
|
901 |
self unescapeCharacterEntities:'&16368;<' |
|
902 |
self unescapeCharacterEntities:'&16368;<' |
|
3557 | 903 |
self unescapeCharacterEntities:'꿾' |
3545 | 904 |
self unescapeCharacterEntities:'"<foo' |
905 |
self unescapeCharacterEntities:'&funny;<foo' |
|
906 |
" |
|
907 |
||
908 |
"Created: / 06-05-2015 / 16:56:14 / sr" |
|
3557 | 909 |
"Modified: / 18-05-2015 / 12:13:35 / sr" |
4937
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
910 |
"Modified: / 17-02-2017 / 10:18:35 / stefan" |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
911 |
! |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
912 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
913 |
urlDecoded:aString |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
914 |
"Convert escaped characters in an urls arguments or post fields back to their proper characters. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
915 |
Undoes the effect of #urlEncoded: and #urlEncoded2:. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
916 |
These are: |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
917 |
+ -> space |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
918 |
%XX ascii as hex digits |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
919 |
%uXXXX unicode as hex digits NOTE: %u is non-standard bit implemented in MS IIS |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
920 |
%% -> % |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
921 |
" |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
922 |
^ (self unEscape:aString) utf8Decoded |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
923 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
924 |
" |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
925 |
self urlDecoded:'a%20b' |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
926 |
self urlDecoded:'a%%b' |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
927 |
self urlDecoded:'a+b' |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
928 |
self urlDecoded:'a%+b' |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
929 |
self urlDecoded:'a%' |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
930 |
self urlDecoded:'a%2' |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
931 |
self urlDecoded:'/Home/a%C3%A4%C3%B6%C3%BCa' |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
932 |
" |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
933 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
934 |
"Created: / 26-08-2018 / 12:49:24 / Claus Gittinger" |
3545 | 935 |
! |
936 |
||
2522 | 937 |
urlEncode2:aStringOrStream on:ws |
4937
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
938 |
<resource: #obsolete> |
2522 | 939 |
"helper to escape invalid/dangerous characters in an urls arguments. |
940 |
Similar to urlEncode, but treats '*','~' and spaces differently. |
|
941 |
(some clients, such as bitTorrent seem to require this - time will tell...) |
|
2523 | 942 |
Any byte not in the set 0-9, a-z, A-Z, '.', '-', '_', is encoded using |
2522 | 943 |
the '%nn' format, where nn is the hexadecimal value of the byte. |
944 |
see: RFC1738" |
|
945 |
||
946 |
|rs c space| |
|
947 |
||
948 |
space := Character space. |
|
949 |
rs := aStringOrStream readStream. |
|
950 |
||
951 |
[rs atEnd] whileFalse: [ |
|
952 |
c := rs next. |
|
953 |
||
2523 | 954 |
(c isLetterOrDigit or:[ ('-_.' includes:c) ]) ifTrue:[ |
2522 | 955 |
ws nextPut:c. |
956 |
] ifFalse:[ |
|
957 |
ws nextPut: $%. |
|
3544 | 958 |
c codePoint > 16rFF ifTrue:[ |
959 |
ws nextPut: $u. |
|
960 |
c codePoint printOn:ws base:16 size:4 fill:$0. |
|
961 |
] ifFalse:[ |
|
962 |
c codePoint printOn:ws base:16 size:2 fill:$0. |
|
963 |
] |
|
2522 | 964 |
]. |
965 |
]. |
|
966 |
||
967 |
"Created: / 09-01-2011 / 10:32:27 / cg" |
|
2523 | 968 |
"Modified: / 09-01-2011 / 13:11:17 / cg" |
3544 | 969 |
"Modified: / 06-05-2015 / 15:43:39 / sr" |
2058 | 970 |
! |
971 |
||
2500 | 972 |
urlEncode:aStringOrStream on:ws |
4937
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
973 |
"helper to escape invalid/dangerous characters in an urlÄs argument or post-fields. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
974 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
975 |
Any byte not in the set 0-9, a-z, A-Z, '.', '-', '_' and '~', |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
976 |
is encoded using the '%nn' format, where nn is the hexadecimal value of the byte. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
977 |
Characters outside the ASCII range are encoded into utf8 first. |
2522 | 978 |
Spaces are encoded as '+'. |
979 |
see: application/x-www-form-urlencoded |
|
4937
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
980 |
see: https://tools.ietf.org/html/rfc3986 (obsoletes RFC1738)" |
2058 | 981 |
|
4937
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
982 |
|rs c| |
2058 | 983 |
|
2500 | 984 |
rs := aStringOrStream readStream. |
2058 | 985 |
|
4937
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
986 |
[(c := rs nextOrNil) notNil] whileTrue: [ |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
987 |
|cp| |
2058 | 988 |
|
4937
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
989 |
(c isLetterOrDigit or:['-_.~' includes:c]) ifTrue:[ |
2058 | 990 |
ws nextPut:c. |
991 |
] ifFalse:[ |
|
4937
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
992 |
c == Character space ifTrue:[ |
2058 | 993 |
ws nextPut:$+. |
994 |
] ifFalse:[ |
|
4937
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
995 |
cp := c codePoint. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
996 |
cp > 16r7F ifTrue:[ |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
997 |
c utf8Encoded do:[:eachUtf8Char| |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
998 |
ws nextPut: $%. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
999 |
eachUtf8Char codePoint printOn:ws base:16 size:2 fill:$0. |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
1000 |
]. |
3544 | 1001 |
] ifFalse:[ |
4937
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
1002 |
ws nextPut: $%. |
3544 | 1003 |
cp printOn:ws base:16 size:2 fill:$0. |
1004 |
]. |
|
2058 | 1005 |
]. |
1006 |
]. |
|
1007 |
]. |
|
2522 | 1008 |
|
4937
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
1009 |
" |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
1010 |
self urlEncoded:'hokus pokus fidibus*-/~' |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
1011 |
self urlEncoded:'Ützel Brötzel*-/~' |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
1012 |
self urlEncoded:'χαιρε' |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
1013 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
1014 |
self urlDecoded:(self urlEncoded:'hokus pokus fidibus*-/~') |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
1015 |
self urlDecoded:(self urlEncoded:'Ützel Brötzel*-/~') |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
1016 |
self urlDecoded:(self urlEncoded:'χαιρε') |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
1017 |
" |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
1018 |
|
2522 | 1019 |
"Modified: / 09-01-2011 / 10:43:30 / cg" |
3544 | 1020 |
"Modified: / 06-05-2015 / 16:06:52 / sr" |
4937
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
1021 |
"Modified (comment): / 07-02-2017 / 14:51:42 / stefan" |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
1022 |
"Modified (comment): / 26-08-2018 / 12:50:04 / Claus Gittinger" |
2522 | 1023 |
! |
1024 |
||
1025 |
urlEncoded2: aString |
|
4937
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
1026 |
<resource: #obsolete> |
2522 | 1027 |
"helper to escape invalid/dangerous characters in an urls arguments or post-fields. |
1028 |
Similar to urlEncoded, but treats '*','~' and spaces differently. |
|
1029 |
(some clients, such as bitTorrent seem to require this - time will tell...) |
|
1030 |
Any byte not in the set 0-9, a-z, A-Z, '.', '-', '_' and '~', is encoded using |
|
1031 |
the '%nn' format, where nn is the hexadecimal value of the byte. |
|
1032 |
see: application/x-www-form-urlencoded |
|
1033 |
see: RFC1738" |
|
1034 |
||
1035 |
|ws| |
|
1036 |
||
1037 |
ws := String writeStreamWithInitialSize:aString size. |
|
1038 |
self urlEncode2:aString on:ws. |
|
1039 |
^ ws contents |
|
1040 |
||
1041 |
||
1042 |
" |
|
1043 |
self unEscape:(self urlEncoded:'_-.*Frankfurt(Main) Hbf') |
|
1044 |
self urlEncoded2:'_-.*Frankfurt(Main) Hbf' |
|
1045 |
||
1046 |
self unEscape:(self urlEncoded:'-_.*%exept;') |
|
1047 |
self urlEncoded2:'-_.*%exept;' |
|
1048 |
self urlEncoded:'-_.*%exept;' |
|
1049 |
" |
|
1050 |
||
1051 |
"Created: / 09-01-2011 / 10:34:50 / cg" |
|
2500 | 1052 |
! |
1053 |
||
1054 |
urlEncoded: aString |
|
1055 |
"helper to escape invalid/dangerous characters in an urls arguments or post-fields. |
|
4937
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
1056 |
|
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
1057 |
Any byte not in the set 0-9, a-z, A-Z, '.', '-', '_' and '~', is encoded using |
2522 | 1058 |
the '%nn' format, where nn is the hexadecimal value of the byte. |
4937
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
1059 |
Characters outside the ASCII range are encoded into utf8 first. |
2522 | 1060 |
Spaces are encoded as '+'. |
1061 |
see: application/x-www-form-urlencoded |
|
4937
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
1062 |
see: https://tools.ietf.org/html/rfc3986 (obsoletes RFC1738)" |
2500 | 1063 |
|
1064 |
|ws| |
|
1065 |
||
4937
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
1066 |
ws := WriteStream on:(String new:aString size + 20). |
2500 | 1067 |
self urlEncode:aString on:ws. |
2058 | 1068 |
^ ws contents |
1069 |
||
1070 |
||
1071 |
" |
|
2500 | 1072 |
self unEscape:(self urlEncoded:'_-.*Frankfurt(Main) Hbf') |
1073 |
self urlEncoded:'_-.*Frankfurt(Main) Hbf' |
|
1074 |
||
1075 |
self unEscape:(self urlEncoded:'-_.*%exept;') |
|
1076 |
self urlEncoded:'-_.*%exept;' |
|
2058 | 1077 |
" |
2464 | 1078 |
|
2522 | 1079 |
"Modified: / 09-01-2011 / 10:43:37 / cg" |
4937
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
1080 |
"Modified: / 07-02-2017 / 14:54:12 / stefan" |
2066 | 1081 |
! |
1082 |
||
2436
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1083 |
withAllSpecialHTMLCharactersEscaped:aStringOrCharacter |
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1084 |
"replace ampersand, less, greater and quotes by html-character escapes" |
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1085 |
|
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1086 |
"/ TODO: this is similar to escapeCharacterEntities. |
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1087 |
"/ we should refactor this into one method only (can we do hex escapes always ?). |
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1088 |
"/ Notice, that these two methods came into existance due to historic reasons |
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1089 |
"/ and were developed independent of each other, but later moved to this common place. |
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1090 |
|
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1091 |
|resultStream| |
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1092 |
|
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1093 |
"/ orgs := #( $& $< $> $" $'). |
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1094 |
"/ repls := #( '&' '<' '>' " '). |
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1095 |
|
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1096 |
(aStringOrCharacter isString |
3098 | 1097 |
and:[ (aStringOrCharacter includesAny:'&<>''"') not ]) ifTrue:[^ aStringOrCharacter]. |
2436
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1098 |
|
3544 | 1099 |
resultStream := CharacterWriteStream on:''. |
2436
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1100 |
aStringOrCharacter asString do:[:eachCharacter | |
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1101 |
"/ huh - a switch. Sorry, but this method is used heavily. |
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1102 |
eachCharacter == $& |
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1103 |
ifTrue:[ resultStream nextPutAll:'&' ] |
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1104 |
ifFalse:[ |
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1105 |
eachCharacter == $< |
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1106 |
ifTrue:[ resultStream nextPutAll:'<' ] |
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1107 |
ifFalse:[ |
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1108 |
eachCharacter == $> |
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1109 |
ifTrue:[ resultStream nextPutAll:'>' ] |
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1110 |
ifFalse:[ |
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1111 |
eachCharacter == $" |
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1112 |
ifTrue:[ resultStream nextPutAll:'"' ] |
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1113 |
ifFalse:[ |
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1114 |
eachCharacter == $' |
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1115 |
ifTrue:[ resultStream nextPutAll:''' ] |
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1116 |
ifFalse:[ |
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1117 |
resultStream nextPut:eachCharacter |
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1118 |
]]]]]. |
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1119 |
]. |
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1120 |
^ resultStream contents |
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1121 |
|
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1122 |
" |
3312 | 1123 |
self withAllSpecialHTMLCharactersEscaped:'<>#&' |
1124 |
self withAllSpecialHTMLCharactersEscaped:$< |
|
1125 |
self withAllSpecialHTMLCharactersEscaped:$# |
|
2436
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1126 |
" |
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1127 |
|
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1128 |
"Modified: / 05-12-2006 / 13:48:59 / cg" |
3544 | 1129 |
"Modified: / 06-05-2015 / 15:41:06 / sr" |
2436
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1130 |
! |
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1131 |
|
2066 | 1132 |
withSpecialHTMLCharactersEscaped:aStringOrCharacter |
1133 |
"replace ampersand, less and greater by html-character escapes" |
|
1134 |
||
1135 |
"/ TODO: this is similar to escapeCharacterEntities. |
|
1136 |
"/ we should refactor this into one method only (can we do hex escapes always ?). |
|
1137 |
"/ Notice, that these two methods came into existance due to historic reasons |
|
1138 |
"/ and were developed independent of each other, but later moved to this common place. |
|
1139 |
||
2866 | 1140 |
|resultStream| |
2066 | 1141 |
|
1142 |
"/ orgs := #( $& $< $> ). |
|
1143 |
"/ repls := #( '&' '<' '>' ). |
|
1144 |
||
1145 |
(aStringOrCharacter isString |
|
2866 | 1146 |
and:[ (aStringOrCharacter isWideString not) |
1147 |
and:[ (aStringOrCharacter includesAny:'&<>') not ]]) ifTrue:[^ aStringOrCharacter]. |
|
2066 | 1148 |
|
3544 | 1149 |
resultStream := CharacterWriteStream on:''. |
2066 | 1150 |
aStringOrCharacter asString do:[:eachCharacter | |
1151 |
"/ huh - a switch. Sorry, but this method is used heavily. |
|
1152 |
eachCharacter == $& |
|
1153 |
ifTrue:[ resultStream nextPutAll:'&' ] |
|
1154 |
ifFalse:[ |
|
1155 |
eachCharacter == $< |
|
1156 |
ifTrue:[ resultStream nextPutAll:'<' ] |
|
1157 |
ifFalse:[ |
|
1158 |
eachCharacter == $> |
|
1159 |
ifTrue:[ resultStream nextPutAll:'>' ] |
|
1160 |
ifFalse:[ |
|
2554
7cd0f7a16fad
changed: #withSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2523
diff
changeset
|
1161 |
"/ eachCharacter codePoint > 16r7F |
7cd0f7a16fad
changed: #withSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2523
diff
changeset
|
1162 |
"/ ifTrue:[ |
7cd0f7a16fad
changed: #withSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2523
diff
changeset
|
1163 |
"/ resultStream |
7cd0f7a16fad
changed: #withSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2523
diff
changeset
|
1164 |
"/ nextPutAll:'&#'; |
7cd0f7a16fad
changed: #withSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2523
diff
changeset
|
1165 |
"/ nextPutAll:(eachCharacter codePoint printString); |
7cd0f7a16fad
changed: #withSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2523
diff
changeset
|
1166 |
"/ nextPutAll:';'] |
7cd0f7a16fad
changed: #withSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2523
diff
changeset
|
1167 |
"/ ifFalse:[ |
2066 | 1168 |
resultStream nextPut:eachCharacter |
2554
7cd0f7a16fad
changed: #withSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2523
diff
changeset
|
1169 |
"/ ] |
2066 | 1170 |
]]]. |
1171 |
]. |
|
1172 |
^ resultStream contents |
|
1173 |
||
1174 |
" |
|
1175 |
self withSpecialHTMLCharactersEscaped:'<>#&' |
|
1176 |
self withSpecialHTMLCharactersEscaped:$< |
|
1177 |
self withSpecialHTMLCharactersEscaped:$# |
|
1178 |
" |
|
1179 |
||
2554
7cd0f7a16fad
changed: #withSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2523
diff
changeset
|
1180 |
"Modified: / 13-04-2011 / 23:13:32 / cg" |
3544 | 1181 |
"Modified: / 06-05-2015 / 15:41:16 / sr" |
2058 | 1182 |
! ! |
1183 |
||
3647 | 1184 |
!HTMLUtilities class methodsFor:'queries'! |
1185 |
||
1186 |
isUtilityClass |
|
1187 |
^ self == HTMLUtilities |
|
1188 |
! ! |
|
1189 |
||
2058 | 1190 |
!HTMLUtilities class methodsFor:'serving-helpers'! |
1191 |
||
1192 |
escape:aString |
|
2436
a5537ae7be4a
added: #withAllSpecialHTMLCharactersEscaped:
Claus Gittinger <cg@exept.de>
parents:
2434
diff
changeset
|
1193 |
"helper to escape invalid/dangerous characters in an url's arguments or post-fields. |
2058 | 1194 |
These are: |
3456 | 1195 |
control characters, dQuote, '+', ';', '?', '&' and space -> %XX ascii as hex digits |
2058 | 1196 |
% -> %% |
1197 |
" |
|
1198 |
||
3544 | 1199 |
| rs ws c cp| |
2058 | 1200 |
|
1201 |
rs := ReadStream on: aString. |
|
1202 |
ws := WriteStream on: ''. |
|
1203 |
[ rs atEnd ] whileFalse: [ |
|
1204 |
c := rs next. |
|
1205 |
c == $% ifTrue:[ |
|
1206 |
ws nextPutAll: '%%'. |
|
1207 |
] ifFalse:[ |
|
3544 | 1208 |
(((cp := c codePoint) < 16r7F) |
3456 | 1209 |
and:[ ('+;?&" ' includes:c) not ]) ifTrue: [ |
2058 | 1210 |
ws nextPut: c. |
1211 |
] ifFalse:[ |
|
1212 |
ws nextPut: $%. |
|
4217 | 1213 |
cp printOn:ws base:16 size:(cp > 16rFF ifTrue:[4] ifFalse:[2]) fill:$0. |
2058 | 1214 |
] |
1215 |
] |
|
1216 |
]. |
|
1217 |
^ ws contents |
|
1218 |
||
1219 |
" |
|
1220 |
self escape:'a b' |
|
1221 |
self escape:'a%b' |
|
1222 |
self escape:'a b' |
|
1223 |
self escape:'a+b' |
|
4769
89914ccfcf7d
Issue #239: Fix all Smalltak/X source files to be in unicode (UTF8 without BOM) and prefixed by "{ Encoding: utf8 }" when any unicode character is present
Patrik Svestka <patrik.svestka@gmail.com>
parents:
4287
diff
changeset
|
1224 |
self escape:'aäüöb' |
2058 | 1225 |
" |
3544 | 1226 |
|
1227 |
"Modified: / 06-05-2015 / 16:07:18 / sr" |
|
4217 | 1228 |
"Modified: / 25-11-2016 / 16:37:53 / cg" |
2058 | 1229 |
! ! |
1230 |
||
2144 | 1231 |
!HTMLUtilities class methodsFor:'text processing helpers'! |
1232 |
||
1233 |
plainTextOfHTML:htmlString |
|
1234 |
"given some HTML, extract the raw text. |
|
1235 |
Can be used to search for strings in some html text." |
|
1236 |
||
3545 | 1237 |
|parser doc s first| |
2144 | 1238 |
|
1239 |
parser := HTMLParser new. |
|
1240 |
doc := parser parseText:htmlString. |
|
3660 | 1241 |
s := CharacterWriteStream on:(String new:100). |
3545 | 1242 |
first := true. |
2144 | 1243 |
doc markUpElementsDo:[:el | |
1244 |
|t| |
|
1245 |
||
1246 |
el isTextElement ifTrue:[ |
|
1247 |
t := el text withoutSeparators. |
|
1248 |
t notEmpty ifTrue:[ |
|
3545 | 1249 |
first ifFalse:[ |
1250 |
s space. |
|
1251 |
]. |
|
2144 | 1252 |
s nextPutAll:t. |
3545 | 1253 |
first := false |
2144 | 1254 |
]. |
1255 |
] ifFalse:[ |
|
1256 |
"/ ignore non-text; however, we could care for text in info-titles |
|
1257 |
"/ or scripts as well... |
|
1258 |
]. |
|
1259 |
]. |
|
3659 | 1260 |
^ s contents |
2144 | 1261 |
|
1262 |
" |
|
1263 |
self plainTextOfHTML:' |
|
4937
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
1264 |
bla1 bla2 <br>bla3 <table><tr><td>bla4</td></tr></table> bla5<p>bla6' |
b1402d9b1f39
Cherry-pick `HTMLUtilities` to catch yp with changes in `stx:libhtml`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
4769
diff
changeset
|
1265 |
self plainTextOfHTML:'Hello World' |
2144 | 1266 |
" |
3545 | 1267 |
|
1268 |
"Modified: / 06-05-2015 / 17:02:36 / sr" |
|
2144 | 1269 |
! ! |
1270 |
||
2058 | 1271 |
!HTMLUtilities class methodsFor:'documentation'! |
1272 |
||
1273 |
version |
|
3640 | 1274 |
^ '$Header$' |
2434
5625df4b6119
comment/format in: #escapeCharacterEntities:
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
1275 |
! |
5625df4b6119
comment/format in: #escapeCharacterEntities:
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
1276 |
|
5625df4b6119
comment/format in: #escapeCharacterEntities:
Claus Gittinger <cg@exept.de>
parents:
2179
diff
changeset
|
1277 |
version_CVS |
3640 | 1278 |
^ '$Header$' |
2058 | 1279 |
! ! |
3098 | 1280 |