Skip to content

Commit b03550d

Browse files
committed
Merge pull request #96 from SWTI2014/parsing/html-entities
2 parents 6de0053 + 4076024 commit b03550d

File tree

14 files changed

+30
-10
lines changed

14 files changed

+30
-10
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
testing
2+
test07HtmlEntitiesShouldBeParsedEverywhere
3+
| document |
4+
document := HtmlDocument new.
5+
document parseContents:
6+
(ReadStream on: '<title>Test &auml;, &ouml; and &uuml;</title>',
7+
'<img src=''http:&#47;&#47;'' alt=''&#248; nothing''> </img>').
8+
self assert: '<title>Test ä, ö and ü</title>' equals: document children first asString.
9+
self assert: 'http://' equals: document children second src.
10+
self assert: 'ø nothing' equals: document children second alt.

packages/HTML.package/DHtmlFormatterTest.class/methodProperties.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010
"test03HtmlEntitiesShouldBeParsedCorrectly" : "SS 5/27/2014 22:08",
1111
"test04DecimalHtmlEntitiesShouldBeParsedCorrectly" : "SS 5/27/2014 21:24",
1212
"test05HexadecimalHtmlEntitiesShouldBeParsedCorrectly" : "SS 5/27/2014 22:09",
13-
"test06NonHtmlEntitiesShouldBeReturned" : "SS 5/27/2014 22:09" } }
13+
"test06NonHtmlEntitiesShouldBeReturned" : "SS 5/27/2014 22:09",
14+
"test07HtmlEntitiesShouldBeParsedEverywhere" : "SS 6/5/2014 19:04" } }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
accessing
22
innerContents
33

4-
^self rawContent asUnHtml
4+
^self rawContent

packages/HTML.package/HtmlCDATANode.class/methodProperties.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"asString" : "tb 1/3/2006 17:36",
77
"checkForUnescapedCharacters" : "tb 3/1/2006 15:36",
88
"initialize" : "j.c 6/6/2007 14:02",
9-
"innerContents" : "SS 5/27/2014 20:35",
9+
"innerContents" : "SS 6/5/2014 11:33",
1010
"isCDATA" : "tb 12/2/2005 09:13",
1111
"prefix" : "tb 12/8/2005 12:02",
1212
"suffix" : "tb 12/8/2005 12:02",

packages/HTML.package/HtmlDOMNode.class/instance/attributes..st

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ attributes: anObject
33
"Set the value of attributes"
44

55
| cstr |
6-
7-
attributes := anObject.
6+
7+
attributes := Dictionary new.
8+
anObject keysAndValuesDo:
9+
[ :eachKey :eachValue | attributes at: eachKey put: eachValue asUnHtml].
810
id := (attributes at: 'id' ifAbsent: [nil]).
911
cstr := attributes at: 'class' ifAbsent: [nil].
1012
classes := cstr isNil ifTrue: [#()] ifFalse: [cstr findTokens: ' '].

packages/HTML.package/HtmlDOMNode.class/methodProperties.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"addToHtmlMorph:" : "rs 5/28/2014 12:40:28.418",
1010
"associatedForm" : "rs 5/29/2014 23:10:34.728",
1111
"attributes" : "tb 11/30/2005 12:26",
12-
"attributes:" : "tb 7/12/2007 11:04",
12+
"attributes:" : "SS 6/7/2014 10:27",
1313
"childDTDTags" : "tb 12/1/2005 09:11",
1414
"childTags" : "tb 12/1/2005 09:12",
1515
"classes" : "tb 1/4/2006 13:52",

packages/HTML.package/HtmlIMGNode.class/methodProperties.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
},
44
"instance" : {
55
"addToFormatter:" : "SN 5/25/2014 15:55",
6-
"alt" : "pf 5/18/2014 13:54",
6+
"alt" : "SS 6/5/2014 11:34",
77
"imageExtent" : "pf 5/18/2014 13:52",
88
"src" : "pf 5/18/2014 13:53",
99
"tag" : "" } }

packages/HTML.package/HtmlParseNode.class/instance/rawContent.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ rawContent
55

66
in := ReadStream on: self document content.
77
in position: self start.
8-
^in next: (self end - self start)
8+
^ (in next: (self end - self start)) asUnHtml

packages/HTML.package/HtmlParseNode.class/methodProperties.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"parseContents:" : "tb 1/3/2006 17:15",
3737
"prefix" : "tb 1/3/2006 16:47",
3838
"prefixId" : "tb 1/3/2006 16:47",
39-
"rawContent" : "tb 1/3/2006 16:47",
39+
"rawContent" : "SS 6/5/2014 11:33",
4040
"start" : "tb 1/3/2006 16:47",
4141
"start:" : "sebastian.sastre 9/20/2010 11:52",
4242
"startForNextElement" : "tb 1/3/2006 16:47",
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
accessing
2+
innerContents
3+
4+
^self rawContent

packages/HTML.package/HtmlTITLENode.class/methodProperties.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
"class" : {
33
},
44
"instance" : {
5+
"innerContents" : "SS 6/5/2014 11:33",
56
"tag" : "" } }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
395d3b09-0758-43c6-b996-b0bde1577d11
1+
429e44ef-e21e-4f8a-9b16-0d1f975279c6

packages/HTML.package/monticello.meta/version.d/HTML-SS.73_265cd527-7860-4ed2-9ef0-84086c072947

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(name 'HTML-SS.73'message 'Add test to check HTML entities are parsed everywhere correctly'id '265cd527-7860-4ed2-9ef0-84086c072947'date '5 June 2014'time '7:06:27.091 pm'author 'SS'ancestors ((id '395d3b09-0758-43c6-b996-b0bde1577d11'))stepChildren ())

packages/HTML.package/monticello.meta/version.d/HTML-SS.74_429e44ef-e21e-4f8a-9b16-0d1f975279c6

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(name 'HTML-SS.74'message 'Run asUnHtml only once when attributes are set.'id '429e44ef-e21e-4f8a-9b16-0d1f975279c6'date '7 June 2014'time '10:29:46.122 am'author 'SS'ancestors ((id '265cd527-7860-4ed2-9ef0-84086c072947'))stepChildren ())

0 commit comments

Comments
 (0)