-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from SWTI2014/css/inline-css-support
- Loading branch information
Showing
136 changed files
with
531 additions
and
132 deletions.
There are no files selected for viewing
Empty file.
10 changes: 10 additions & 0 deletions
10
packages/HTML.package/CSSFontFormatter.class/instance/attributeMap.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
accessing | ||
attributeMap | ||
|
||
^ attributeMap ifNil: | ||
[ Dictionary newFrom: { | ||
'font' -> [ :prop :fontAttribs | self readFontAttribute: prop propertyString to: fontAttribs ]. | ||
'font-style' -> [ :prop :fontAttribs | self readFontStyleAttribute: prop propertyString to: fontAttribs ]. | ||
'font-weight' -> [ :prop :fontAttribs | self readFontWeightAttribute: prop propertyString to: fontAttribs ]. | ||
'font-size' -> [ :prop :fontAttribs | self readFontSizeAttribute: prop propertyString to: fontAttribs ] | ||
}] |
4 changes: 4 additions & 0 deletions
4
packages/HTML.package/CSSFontFormatter.class/instance/isValidStyleValue..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
parsing | ||
isValidStyleValue: aString | ||
|
||
^ {'normal'. 'italic'. 'oblique'. 'initial'. 'inherit'} includes: aString |
4 changes: 4 additions & 0 deletions
4
packages/HTML.package/CSSFontFormatter.class/instance/isValidWeightValue..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
parsing | ||
isValidWeightValue: aString | ||
|
||
^ {'normal'. 'bold'. 'bolder'. 'lighter'. '100'. '200'. '300'. '400'. '500'. '600'. '700'. '800'. '900'. 'initial'. 'inherit'} includes: aString |
5 changes: 5 additions & 0 deletions
5
packages/HTML.package/CSSFontFormatter.class/instance/parseTextAttributesFrom.into..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
parsing | ||
parseTextAttributesFrom: aCSSProperty into: aContext | ||
|
||
(self attributeMap at: aCSSProperty propertyName ifAbsent: [nil]) | ||
ifNotNilDo: [ :process | process value: aCSSProperty value: aContext ] |
22 changes: 22 additions & 0 deletions
22
packages/HTML.package/CSSFontFormatter.class/instance/readFontAttribute.to..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
parsing | ||
readFontAttribute: aString to: aContext | ||
| values shorthandContext | | ||
shorthandContext := Dictionary newFrom: { | ||
#italic -> false. | ||
#bold -> false. | ||
#size -> TextStyle default defaultFontIndex | ||
}. | ||
|
||
values := aString splitOn: ' '. | ||
values size >= 2 ifTrue: [ | ||
self readFontSizeAttribute: (values nextToLast splitOn: '/') first to: shorthandContext]. | ||
values size >= 3 ifTrue: [ | ||
(self isValidStyleValue: values first) | ||
ifTrue: [ self readFontStyleAttribute: values first to: shorthandContext. | ||
values size >= 4 | ||
ifTrue: [self readFontWeightAttribute: values second to: shorthandContext ]] | ||
ifFalse: [ | ||
(self isValidWeightValue: values first) | ||
ifTrue: [self readFontWeightAttribute: values first to: shorthandContext ]]]. | ||
|
||
aContext addAll: shorthandContext |
30 changes: 30 additions & 0 deletions
30
packages/HTML.package/CSSFontFormatter.class/instance/readFontSizeAttribute.to..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
parsing | ||
readFontSizeAttribute: aString to: aContext | ||
"Lots of value types possible: http://www.w3schools.com/cssref/pr_font_font-size.asp" | ||
| defaultSize sizeFactors | | ||
defaultSize := TextStyle default defaultFontIndex. | ||
((aString endsWith: '%') or: (aString endsWith: 'em')) ifTrue: [ | ||
| parentFontSize | | ||
"This is actually not the parent font size but the font size of a rule that should be overridden" | ||
parentFontSize := aContext at: #size ifAbsent: [ defaultSize ]. | ||
aString asNumber ifNotNil: [:value | | ||
(aString endsWith: '%') | ||
ifTrue: [ aContext at: #size put: ((parentFontSize * (value / 100)) max: 1) asInteger ] | ||
ifFalse: [ aContext at: #size put: ((parentFontSize * value) max: 1) asInteger ]]. | ||
^ self ]. | ||
|
||
(aString endsWith: 'cm') ifTrue: | ||
[ aString asNumber ifNotNil: [:value | aContext at: #size put: (value * 4) asInteger]. | ||
^ self]. | ||
|
||
sizeFactors := Dictionary newFrom: { | ||
'initial' -> 1. | ||
'xx-small' -> 0.5. | ||
'x-small' -> 0.6. | ||
'small' -> 0.8. | ||
'medium' -> 1. | ||
'large' -> 1.5. | ||
'x-large' -> 2. | ||
'xx-large' -> 3. | ||
}. | ||
aContext at: #size put: ((sizeFactors at: aString ifAbsent: [1]) * defaultSize) asInteger |
9 changes: 9 additions & 0 deletions
9
packages/HTML.package/CSSFontFormatter.class/instance/readFontStyleAttribute.to..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
parsing | ||
readFontStyleAttribute: aString to: aContext | ||
| map | | ||
map := Dictionary newFrom: { | ||
'italic' -> true. | ||
'normal' -> false | ||
}. | ||
|
||
(map at: aString ifAbsent: [nil]) ifNotNilDo: [:value | aContext at: #italic put: value] |
9 changes: 9 additions & 0 deletions
9
packages/HTML.package/CSSFontFormatter.class/instance/readFontWeightAttribute.to..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
parsing | ||
readFontWeightAttribute: aString to: aContext | ||
| map | | ||
map := Dictionary newFrom: { | ||
'bold' -> true. | ||
'normal' -> false | ||
}. | ||
|
||
(map at: aString ifAbsent: [nil]) ifNotNilDo: [:value | aContext at: #bold put: value] |
12 changes: 12 additions & 0 deletions
12
packages/HTML.package/CSSFontFormatter.class/methodProperties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"class" : { | ||
}, | ||
"instance" : { | ||
"attributeMap" : "rs 5/21/2014 12:46:49.11", | ||
"isValidStyleValue:" : "rs 5/21/2014 15:44:29.914", | ||
"isValidWeightValue:" : "rs 5/21/2014 15:43:47.846", | ||
"parseTextAttributesFrom:into:" : "rs 5/21/2014 12:21:23.822", | ||
"readFontAttribute:to:" : "rs 5/21/2014 16:06:04.462", | ||
"readFontSizeAttribute:to:" : "rs 5/21/2014 16:15:51.59", | ||
"readFontStyleAttribute:to:" : "rs 5/21/2014 11:48:15.832", | ||
"readFontWeightAttribute:to:" : "rs 5/21/2014 11:48:27.886" } } |
14 changes: 14 additions & 0 deletions
14
packages/HTML.package/CSSFontFormatter.class/properties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"category" : "HTML-Formatter", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "", | ||
"instvars" : [ | ||
"attributeMap" ], | ||
"name" : "CSSFontFormatter", | ||
"pools" : [ | ||
], | ||
"super" : "CSSFormatter", | ||
"type" : "normal" } |
Empty file.
4 changes: 4 additions & 0 deletions
4
packages/HTML.package/CSSFontFormatterTest.class/instance/fontFormatter..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
fontFormatter: anObject | ||
|
||
fontFormatter := anObject |
4 changes: 4 additions & 0 deletions
4
packages/HTML.package/CSSFontFormatterTest.class/instance/fontFormatter.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
fontFormatter | ||
|
||
^ fontFormatter |
3 changes: 3 additions & 0 deletions
3
packages/HTML.package/CSSFontFormatterTest.class/instance/setUp.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
running | ||
setUp | ||
self fontFormatter: CSSFontFormatter new |
11 changes: 11 additions & 0 deletions
11
...ackage/CSSFontFormatterTest.class/instance/test01FontItalicBoldShouldBeParsedCorrectly.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
testing | ||
test01FontItalicBoldShouldBeParsedCorrectly | ||
| prop result | | ||
result := Dictionary new. | ||
prop := CSSProperty new | ||
propertyName: 'font'; | ||
propertyString: 'italic bold medium Verdana'; | ||
yourself. | ||
self fontFormatter parseTextAttributesFrom: prop into: result. | ||
self assert: true equals: (result at: #italic). | ||
self assert: true equals: (result at: #bold) |
10 changes: 10 additions & 0 deletions
10
...ckage/CSSFontFormatterTest.class/instance/test02FontStyleItalicShouldBeParsedCorrectly.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
testing | ||
test02FontStyleItalicShouldBeParsedCorrectly | ||
| prop result | | ||
result := Dictionary new. | ||
prop := CSSProperty new | ||
propertyName: 'font-style'; | ||
propertyString: 'italic'; | ||
yourself. | ||
self fontFormatter parseTextAttributesFrom: prop into: result. | ||
self assert: (result at: #italic) equals: true |
10 changes: 10 additions & 0 deletions
10
...ackage/CSSFontFormatterTest.class/instance/test03FontWeightBoldShouldBeParsedCorrectly.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
testing | ||
test03FontWeightBoldShouldBeParsedCorrectly | ||
| prop result | | ||
result := Dictionary new. | ||
prop := CSSProperty new | ||
propertyName: 'font-weight'; | ||
propertyString: 'bold'; | ||
yourself. | ||
self fontFormatter parseTextAttributesFrom: prop into: result. | ||
self assert: (result at: #bold) equals: true. |
12 changes: 12 additions & 0 deletions
12
...kage/CSSFontFormatterTest.class/instance/test04ComplexFontValueShouldBeParsedCorrectly.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
testing | ||
test04ComplexFontValueShouldBeParsedCorrectly | ||
| prop result | | ||
result := Dictionary new. | ||
prop := CSSProperty new | ||
propertyName: 'font'; | ||
propertyString: 'bold xx-large/180% Verdana'; | ||
yourself. | ||
self fontFormatter parseTextAttributesFrom: prop into: result. | ||
self assert: false equals: (result at: #italic). | ||
self assert: true equals: (result at: #bold). | ||
self assert: 3*2 equals: (result at: #size) |
11 changes: 11 additions & 0 deletions
11
packages/HTML.package/CSSFontFormatterTest.class/methodProperties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"class" : { | ||
}, | ||
"instance" : { | ||
"fontFormatter" : "rs 5/19/2014 19:50:21.108", | ||
"fontFormatter:" : "rs 5/19/2014 19:50:21.12", | ||
"setUp" : "rs 5/19/2014 19:50:35.284", | ||
"test01FontItalicBoldShouldBeParsedCorrectly" : "rs 5/21/2014 16:21:36.626", | ||
"test02FontStyleItalicShouldBeParsedCorrectly" : "rs 5/21/2014 16:21:29.714", | ||
"test03FontWeightBoldShouldBeParsedCorrectly" : "rs 5/21/2014 16:21:22.976", | ||
"test04ComplexFontValueShouldBeParsedCorrectly" : "rs 5/21/2014 16:21:15.452" } } |
14 changes: 14 additions & 0 deletions
14
packages/HTML.package/CSSFontFormatterTest.class/properties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"category" : "HTML-Tests", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "", | ||
"instvars" : [ | ||
"fontFormatter" ], | ||
"name" : "CSSFontFormatterTest", | ||
"pools" : [ | ||
], | ||
"super" : "TestCase", | ||
"type" : "normal" } |
Empty file.
3 changes: 3 additions & 0 deletions
3
packages/HTML.package/CSSFormatter.class/instance/parseTextAttributesFrom.into..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
as yet unclassified | ||
parseTextAttributesFrom: styles into: aContext | ||
self subclassResponsibility |
5 changes: 5 additions & 0 deletions
5
packages/HTML.package/CSSFormatter.class/methodProperties.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"class" : { | ||
}, | ||
"instance" : { | ||
"parseTextAttributesFrom:into:" : "rs 5/21/2014 11:55:57.472" } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"category" : "HTML-Formatter", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "", | ||
"instvars" : [ | ||
], | ||
"name" : "CSSFormatter", | ||
"pools" : [ | ||
], | ||
"super" : "Object", | ||
"type" : "normal" } |
6 changes: 6 additions & 0 deletions
6
packages/HTML.package/DHtmlFormatter.class/instance/cssPrefixMap.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
accessing | ||
cssPrefixMap | ||
^ cssPrefixMap ifNil: [ | ||
Dictionary newFrom: { | ||
'font' -> CSSFontFormatter new | ||
}] |
4 changes: 1 addition & 3 deletions
4
packages/HTML.package/DHtmlFormatter.class/instance/endHeader..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
formatting commands | ||
endHeader: level | ||
boldLevel := boldLevel - 1. "self decreaseBold" | ||
self ensureNewlines: 2. | ||
self endFont: nil. | ||
self ensureNewlines: 2 |
3 changes: 3 additions & 0 deletions
3
packages/HTML.package/DHtmlFormatter.class/instance/endStyles.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
formatting commands | ||
endStyles | ||
self endFont: nil |
5 changes: 5 additions & 0 deletions
5
packages/HTML.package/DHtmlFormatter.class/instance/getFormatterFor..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
formatting commands | ||
getFormatterFor: aCSSProperty | ||
| prefix | | ||
prefix := self getPrefixOf: aCSSProperty propertyName. | ||
^ self cssPrefixMap at: prefix ifAbsent: [nil] |
4 changes: 4 additions & 0 deletions
4
packages/HTML.package/DHtmlFormatter.class/instance/getPrefixOf..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
formatting commands | ||
getPrefixOf: aString | ||
(aString beginsWith: 'font') ifTrue: [ ^ 'font' ]. | ||
^ nil |
8 changes: 8 additions & 0 deletions
8
packages/HTML.package/DHtmlFormatter.class/instance/getTextAttributesFrom..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
private-formatting | ||
getTextAttributesFrom: aDictionary | ||
| attribs | | ||
attribs := OrderedCollection new. | ||
(aDictionary at: #italic ifAbsent: [nil]) ifNotNil: [:italic | italic ifTrue: [ attribs add: TextEmphasis italic ]]. | ||
(aDictionary at: #bold ifAbsent: [nil]) ifNotNil: [:bold | bold ifTrue: [ attribs add: TextEmphasis bold ]]. | ||
(aDictionary at: #size ifAbsent: [nil]) ifNotNil: [:size | attribs add: (TextFontChange fontNumber: size)]. | ||
^ attribs |
2 changes: 1 addition & 1 deletion
2
packages/HTML.package/DHtmlFormatter.class/instance/headerFont..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
formatting commands | ||
headerFont: level | ||
^{TextFontChange fontNumber: ((5 - level) max: 1)} | ||
^TextFontChange fontNumber: ((5 - level) max: 1) |
5 changes: 5 additions & 0 deletions
5
packages/HTML.package/DHtmlFormatter.class/instance/parseCSSProperty.into..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
formatting commands | ||
parseCSSProperty: aCSSProperty into: aContext | ||
|
||
(self getFormatterFor: aCSSProperty) | ||
ifNotNilDo: [:formatter | formatter parseTextAttributesFrom: aCSSProperty into: aContext ] |
8 changes: 8 additions & 0 deletions
8
packages/HTML.package/DHtmlFormatter.class/instance/parseTextAttributes..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
formatting commands | ||
parseTextAttributes: styles | ||
| styleContext | | ||
styleContext := Dictionary new. | ||
styles do: [:style | | ||
style properties do: [:prop | self parseCSSProperty: prop into: styleContext ]]. | ||
|
||
^ self getTextAttributesFrom: styleContext |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 5 additions & 2 deletions
7
packages/HTML.package/DHtmlFormatter.class/instance/startHeader..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
formatting commands | ||
startHeader: level | ||
| attribs | | ||
self ensureNewlines: 3. | ||
boldLevel := boldLevel + 1. "self increaseBold" | ||
self startFont: (self headerFont: level). | ||
attribs := fontSpecs last. | ||
attribs add: (self headerFont: level); | ||
add: TextEmphasis bold. | ||
self setAttributes |
6 changes: 6 additions & 0 deletions
6
packages/HTML.package/DHtmlFormatter.class/instance/startStyles..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
formatting commands | ||
startStyles: styles | ||
| textAttributes | | ||
textAttributes := self parseTextAttributes: styles. | ||
self startFont: textAttributes. | ||
self setAttributes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Oops, something went wrong.