-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename more occurences of attribute to emphasis
Note: While it may not be the most ideal convention, we try to use ItalicEmphasis and StrongEmphasis in the tests to differentiate between "normal" *emphasis* and **strong emphasis** Co-authored-by: Kira Grammel <kira.grammel@student.hpi.de>
- Loading branch information
1 parent
6c9fba9
commit d3c2828
Showing
47 changed files
with
139 additions
and
119 deletions.
There are no files selected for viewing
6 changes: 0 additions & 6 deletions
6
...ore.package/MarkdownEmphasisDelimiter.class/instance/attributeFrom.to.delimiterLength..st
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
...kdownEditor-Core.package/MarkdownEmphasisDelimiter.class/instance/attributeStartingAt..st
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...tance/delimiterLengthForAttributeWith..st → ...stance/delimiterLengthForEmphasisWith..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,4 +1,4 @@ | ||
attributes | ||
delimiterLengthForAttributeWith: aMarkdownEmphasisDelimiter | ||
delimiterLengthForEmphasisWith: aMarkdownEmphasisDelimiter | ||
|
||
^ {self length. aMarkdownEmphasisDelimiter length. self boldLength} min |
6 changes: 6 additions & 0 deletions
6
...Core.package/MarkdownEmphasisDelimiter.class/instance/emphasisFrom.to.delimiterLength..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 @@ | ||
attributes | ||
emphasisFrom: start to: end delimiterLength: aLength | ||
|
||
aLength = 1 | ||
ifTrue: [^ MarkdownEmphasis from: start to: end] | ||
ifFalse: [^ MarkdownEmphasis strongFrom: start to: end] |
9 changes: 9 additions & 0 deletions
9
...rkdownEditor-Core.package/MarkdownEmphasisDelimiter.class/instance/emphasisStartingAt..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 @@ | ||
attributes | ||
emphasisStartingAt: openingEmphasisDelimiter | ||
|
||
| delimiterLength start end | | ||
delimiterLength := self delimiterLengthForEmphasisWith: openingEmphasisDelimiter. | ||
start := openingEmphasisDelimiter endPosition - delimiterLength + 1. | ||
end := self startPosition + delimiterLength - 1. | ||
^ self emphasisFrom: start to: end delimiterLength: delimiterLength | ||
|
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
12 changes: 6 additions & 6 deletions
12
packages/MarkdownEditor-Core.package/MarkdownInlineTextStyler.class/instance/add.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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
styling | ||
add: aCollectionOfMarkdownAttributes to: aText | ||
add: aCollectionOfMarkdownEmphases to: aText | ||
|
||
aCollectionOfMarkdownAttributes do: [:attribute | | ||
aText | ||
addAttribute: attribute textAttribute | ||
from: attribute startPosition | ||
to: attribute endPosition] | ||
aCollectionOfMarkdownEmphases do: [:emphasis | | ||
aText | ||
addAttribute: emphasis textAttribute | ||
from: emphasis startPosition | ||
to: emphasis endPosition] |
4 changes: 0 additions & 4 deletions
4
packages/MarkdownEditor-Core.package/MarkdownInlineTextStyler.class/instance/attributes..st
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
packages/MarkdownEditor-Core.package/MarkdownInlineTextStyler.class/instance/attributes.st
This file was deleted.
Oops, something went wrong.
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
4 changes: 4 additions & 0 deletions
4
packages/MarkdownEditor-Core.package/MarkdownInlineTextStyler.class/instance/emphases..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-private | ||
emphases: aCollectionOfMarkdownEmphases | ||
|
||
emphases := aCollectionOfMarkdownEmphases |
4 changes: 4 additions & 0 deletions
4
packages/MarkdownEditor-Core.package/MarkdownInlineTextStyler.class/instance/emphases.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-private | ||
emphases | ||
|
||
^ emphases |
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 |
---|---|---|
|
@@ -5,5 +5,5 @@ parse: aString | |
clean; | ||
tokenize: aString; | ||
interpretTokens. | ||
^ self attributes | ||
^ self emphases | ||
|
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
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
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
11 changes: 0 additions & 11 deletions
11
...Tests.package/MarkdownEmphasisDelimiterTest.class/instance/testEmphasisAttributeItalic.st
This file was deleted.
Oops, something went wrong.
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
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
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
9 changes: 9 additions & 0 deletions
9
...downEditor-Tests.package/MarkdownEmphasisTest.class/instance/testDifferentEmphasisType.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 @@ | ||
tests | ||
testDifferentEmphasisType | ||
|
||
| emphasis1 emphasis2 | | ||
emphasis1 := MarkdownEmphasis from: 1 to: 2. | ||
emphasis2 := MarkdownEmphasis strongFrom: 1 to: 3. | ||
self | ||
deny: emphasis1 = emphasis2; | ||
deny: emphasis1 hash = emphasis2 hash |
9 changes: 9 additions & 0 deletions
9
...ownEditor-Tests.package/MarkdownEmphasisTest.class/instance/testEndPositionsAreUnequal.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 @@ | ||
tests | ||
testEndPositionsAreUnequal | ||
|
||
| emphasis1 emphasis2 | | ||
emphasis1 := MarkdownEmphasis from: 1 to: 2. | ||
emphasis2 := MarkdownEmphasis from: 1 to: 3. | ||
self | ||
deny: emphasis1 = emphasis2; | ||
deny: emphasis1 hash = emphasis2 hash |
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
9 changes: 9 additions & 0 deletions
9
...nEditor-Tests.package/MarkdownEmphasisTest.class/instance/testStartPositionsAreUnequal.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 @@ | ||
tests | ||
testStartPositionsAreUnequal | ||
|
||
| emphasis1 emphasis2 | | ||
emphasis1 := MarkdownEmphasis from: 1 to: 2. | ||
emphasis2 := MarkdownEmphasis from: 2 to: 2. | ||
self | ||
deny: emphasis1 = emphasis2; | ||
deny: emphasis1 hash = emphasis2 hash |
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
4 changes: 2 additions & 2 deletions
4
...Editor-Tests.package/MarkdownInlineTextStylerTest.class/instance/assert.areEmphasesIn..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,4 +1,4 @@ | ||
accessing | ||
assert: aCollectionOfMarkdownEmphases areEmphasesIn: inlineTextStylerAttributes | ||
assert: expectedEmphases areEmphasesIn: inlineTextStylerEmphases | ||
|
||
self assert: aCollectionOfMarkdownEmphases asBag equals: inlineTextStylerAttributes asBag | ||
self assert: expectedEmphases asBag equals: inlineTextStylerEmphases asBag |
8 changes: 0 additions & 8 deletions
8
...r-Tests.package/MarkdownInlineTextStylerTest.class/instance/testCleanEmptiesAttributes.st
This file was deleted.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
...tor-Tests.package/MarkdownInlineTextStylerTest.class/instance/testCleanEmptiesEmphases.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 @@ | ||
tests - cleaning | ||
testCleanEmptiesEmphases | ||
|
||
inlineTextStyler | ||
emphases: {MarkdownEmphasis from: 1 to: 2} asOrderedCollection; | ||
clean. | ||
|
||
self assert: inlineTextStyler emphases isEmpty |
10 changes: 5 additions & 5 deletions
10
...ts.package/MarkdownInlineTextStylerTest.class/instance/testDelimiterSpansCanNotOverlap.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,9 +1,9 @@ | ||
tests - interpretation | ||
testDelimiterSpansCanNotOverlap | ||
|
||
| attributes | | ||
attributes := inlineTextStyler | ||
inlineTextStyler | ||
parse: '**f*o** o*'. | ||
|
||
self assert: 1 equals: attributes size. | ||
self assert: TextEmphasis bold equals: attributes first textAttribute | ||
|
||
self | ||
assert: {MarkdownEmphasis strongFrom: 1 to: 7} | ||
areEmphasesIn: inlineTextStyler emphases |
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
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
Oops, something went wrong.