--- a/HTMLUtilities.st Wed Mar 27 14:14:36 2019 +0100
+++ b/HTMLUtilities.st Wed Mar 27 15:22:56 2019 +0100
@@ -83,6 +83,7 @@
at:'auml' put:$ä;
at:'ouml' put:$ö;
at:'uuml' put:$ü.
+ "/ where to get the mapping???
"/ Answer: It is a mess. A good start may be
"/ https://www.w3.org/TR/html4/sgml/entities.html with 252 named entities.
"/ I guess an actual lookup table would be adequate.
@@ -90,7 +91,9 @@
HtmlEntityToCharacter := htmlEntityToCharacter.
].
- ^ HtmlEntityToCharacter
+ ^ HtmlEntityToCharacter
+
+ "Modified (comment): / 27-03-2019 / 10:26:27 / Claus Gittinger"
! !
!HTMLUtilities class methodsFor:'helpers'!
@@ -99,12 +102,15 @@
^ self htmlEntityToCharacter
at:anHtmlEntityName
ifAbsent:[
- self halt. "/ where to get the mapping???
+ self halt.
+ "/ where to get the mapping???
"/ Answer: It is a mess. A good start may be
"/ https://www.w3.org/TR/html4/sgml/entities.html with 252 named entities.
"/ I guess an actual lookup table would be adequate.
$~
]
+
+ "Modified (format): / 27-03-2019 / 10:25:58 / Claus Gittinger"
!
controlCharacters
@@ -301,9 +307,14 @@
!
htmlEntityForCharacter:aCharacter
+ aCharacter == Character space ifTrue:[^ nil].
+ aCharacter isLetterOrDigit ifTrue:[^ nil].
+
^ self htmlEntityToCharacter
keyAtValue:aCharacter
ifAbsent:nil
+
+ "Modified: / 27-03-2019 / 10:24:29 / Claus Gittinger"
!
unEscape:aString