-
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.
- Loading branch information
Showing
160 changed files
with
972 additions
and
105 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
packages/MarkdownEditor-Core.package/MarkdownClosingLinkDelimiter.class/README.md
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 @@ | ||
I am a token for links. I listen to closing square brackets. | ||
|
||
Instance Variables |
4 changes: 4 additions & 0 deletions
4
...ges/MarkdownEditor-Core.package/MarkdownClosingLinkDelimiter.class/class/mayBeginWith..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 @@ | ||
testing | ||
mayBeginWith: aCharacter | ||
|
||
^ aCharacter = $] |
4 changes: 4 additions & 0 deletions
4
packages/MarkdownEditor-Core.package/MarkdownClosingLinkDelimiter.class/instance/isCloser.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 @@ | ||
testing | ||
isCloser | ||
|
||
^ true |
4 changes: 4 additions & 0 deletions
4
...es/MarkdownEditor-Core.package/MarkdownClosingLinkDelimiter.class/instance/isDelimiter.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 @@ | ||
testing | ||
isDelimiter | ||
|
||
^ true |
4 changes: 4 additions & 0 deletions
4
...kdownEditor-Core.package/MarkdownClosingLinkDelimiter.class/instance/isExtendableWith..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 @@ | ||
testing | ||
isExtendableWith: aCharacter | ||
|
||
^ aCharacter = $] |
4 changes: 4 additions & 0 deletions
4
packages/MarkdownEditor-Core.package/MarkdownClosingLinkDelimiter.class/instance/isOpener.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 @@ | ||
testing | ||
isOpener | ||
|
||
^ false |
4 changes: 4 additions & 0 deletions
4
...s/MarkdownEditor-Core.package/MarkdownClosingLinkDelimiter.class/instance/linkFrom.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,4 @@ | ||
attribute | ||
linkFrom: start to: end | ||
|
||
^ MarkdownLink from: start to: end |
8 changes: 8 additions & 0 deletions
8
...arkdownEditor-Core.package/MarkdownClosingLinkDelimiter.class/instance/linkStartingAt..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 @@ | ||
attribute | ||
linkStartingAt: openingLinkDelimiter | ||
|
||
| start end | | ||
start := openingLinkDelimiter endPosition. | ||
end := self startPosition. | ||
^ self linkFrom: start to: end | ||
|
4 changes: 4 additions & 0 deletions
4
packages/MarkdownEditor-Core.package/MarkdownClosingLinkDelimiter.class/instance/matches..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 @@ | ||
testing | ||
matches: aMarkdownOpeningDelimiter | ||
|
||
^ aMarkdownOpeningDelimiter class = MarkdownOpeningLinkDelimiter |
4 changes: 4 additions & 0 deletions
4
...ditor-Core.package/MarkdownClosingLinkDelimiter.class/instance/setPreceding.following..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 @@ | ||
initialize-release | ||
setPreceding: precedingCharacter following: followingCharacter | ||
|
||
^ self |
12 changes: 12 additions & 0 deletions
12
...ages/MarkdownEditor-Core.package/MarkdownClosingLinkDelimiter.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" : { | ||
"mayBeginWith:" : "hsl 5/17/2020 12:48" }, | ||
"instance" : { | ||
"isCloser" : "hsl 5/17/2020 13:26", | ||
"isDelimiter" : "hsl 5/17/2020 13:03", | ||
"isExtendableWith:" : "hsl 5/19/2020 11:58", | ||
"isOpener" : "hsl 5/17/2020 13:27", | ||
"linkFrom:to:" : "hsl 5/17/2020 16:05", | ||
"linkStartingAt:" : "hsl 5/17/2020 16:03", | ||
"matches:" : "hsl 5/17/2020 18:10", | ||
"setPreceding:following:" : "hsl 5/17/2020 13:16" } } |
14 changes: 14 additions & 0 deletions
14
packages/MarkdownEditor-Core.package/MarkdownClosingLinkDelimiter.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" : "MarkdownEditor-Core", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "hsl 5/19/2020 11:07", | ||
"instvars" : [ | ||
], | ||
"name" : "MarkdownClosingLinkDelimiter", | ||
"pools" : [ | ||
], | ||
"super" : "MarkdownToken", | ||
"type" : "normal" } |
3 changes: 3 additions & 0 deletions
3
packages/MarkdownEditor-Core.package/MarkdownClosingURLDelimiter.class/README.md
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 @@ | ||
I am a token for links. I listen to closing brackets. | ||
|
||
Instance Variables |
4 changes: 4 additions & 0 deletions
4
...ages/MarkdownEditor-Core.package/MarkdownClosingURLDelimiter.class/class/mayBeginWith..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 @@ | ||
testing | ||
mayBeginWith: aCharacter | ||
|
||
^ aCharacter = $) |
4 changes: 4 additions & 0 deletions
4
packages/MarkdownEditor-Core.package/MarkdownClosingURLDelimiter.class/instance/isCloser.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 @@ | ||
testing | ||
isCloser | ||
|
||
^ true |
4 changes: 4 additions & 0 deletions
4
...ges/MarkdownEditor-Core.package/MarkdownClosingURLDelimiter.class/instance/isDelimiter.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 @@ | ||
testing | ||
isDelimiter | ||
|
||
^ true |
4 changes: 4 additions & 0 deletions
4
...rkdownEditor-Core.package/MarkdownClosingURLDelimiter.class/instance/isExtendableWith..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 @@ | ||
testing | ||
isExtendableWith: aCharacter | ||
|
||
^ aCharacter = $) |
4 changes: 4 additions & 0 deletions
4
packages/MarkdownEditor-Core.package/MarkdownClosingURLDelimiter.class/instance/isOpener.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 @@ | ||
testing | ||
isOpener | ||
|
||
^ false |
4 changes: 4 additions & 0 deletions
4
packages/MarkdownEditor-Core.package/MarkdownClosingURLDelimiter.class/instance/matches..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 @@ | ||
testing | ||
matches: aMarkdownOpeningDelimiter | ||
|
||
^ aMarkdownOpeningDelimiter class = MarkdownOpeningURLDelimiter |
4 changes: 4 additions & 0 deletions
4
...Editor-Core.package/MarkdownClosingURLDelimiter.class/instance/setPreceding.following..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 @@ | ||
initialize-release | ||
setPreceding: precedingCharacter following: followingCharacter | ||
|
||
^ self |
10 changes: 10 additions & 0 deletions
10
packages/MarkdownEditor-Core.package/MarkdownClosingURLDelimiter.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,10 @@ | ||
{ | ||
"class" : { | ||
"mayBeginWith:" : "hsl 5/19/2020 10:59" }, | ||
"instance" : { | ||
"isCloser" : "hsl 5/19/2020 11:11", | ||
"isDelimiter" : "hsl 5/19/2020 11:17", | ||
"isExtendableWith:" : "hsl 5/19/2020 11:17", | ||
"isOpener" : "hsl 5/19/2020 11:16", | ||
"matches:" : "hsl 5/19/2020 11:20", | ||
"setPreceding:following:" : "hsl 5/19/2020 11:25" } } |
14 changes: 14 additions & 0 deletions
14
packages/MarkdownEditor-Core.package/MarkdownClosingURLDelimiter.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" : "MarkdownEditor-Core", | ||
"classinstvars" : [ | ||
], | ||
"classvars" : [ | ||
], | ||
"commentStamp" : "hsl 5/19/2020 11:05", | ||
"instvars" : [ | ||
], | ||
"name" : "MarkdownClosingURLDelimiter", | ||
"pools" : [ | ||
], | ||
"super" : "MarkdownToken", | ||
"type" : "normal" } |
2 changes: 1 addition & 1 deletion
2
packages/MarkdownEditor-Core.package/MarkdownEmphasis.class/README.md
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 +1 @@ | ||
I represent a Markdown emphasis over a range of characters. The applied styling is expressed through my textAttribute. | ||
I represent a Markdown emphasis over a range of characters. The applied styling is expressed through my textAttribute and colorAttribute. |
4 changes: 4 additions & 0 deletions
4
packages/MarkdownEditor-Core.package/MarkdownEmphasis.class/instance/colorAttribute..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 | ||
colorAttribute: aColorAttribute | ||
|
||
colorAttribute := aColorAttribute |
4 changes: 4 additions & 0 deletions
4
packages/MarkdownEditor-Core.package/MarkdownEmphasis.class/instance/colorAttribute.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 | ||
colorAttribute | ||
|
||
^ colorAttribute |
4 changes: 4 additions & 0 deletions
4
packages/MarkdownEditor-Core.package/MarkdownEmphasis.class/instance/initialize.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 @@ | ||
initialize-release | ||
initialize | ||
|
||
colorAttribute := TextColor black |
5 changes: 4 additions & 1 deletion
5
packages/MarkdownEditor-Core.package/MarkdownEmphasis.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
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
15 changes: 10 additions & 5 deletions
15
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,13 @@ | ||
styling | ||
add: aCollectionOfMarkdownEmphases to: aText | ||
add: aCollectionOfMarkdownInlineElements to: aText | ||
|
||
aCollectionOfMarkdownEmphases do: [:emphasis | | ||
aCollectionOfMarkdownInlineElements do: [:element | | ||
aText | ||
addAttribute: emphasis textAttribute | ||
from: emphasis startPosition | ||
to: emphasis endPosition] | ||
addAttribute: element textAttribute | ||
from: element startPosition | ||
to: element endPosition. | ||
|
||
aText | ||
addAttribute: element colorAttribute | ||
from: element startPosition | ||
to: element endPosition] |
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/content..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 | ||
content: aString | ||
|
||
content := aString |
4 changes: 4 additions & 0 deletions
4
packages/MarkdownEditor-Core.package/MarkdownInlineTextStyler.class/instance/content.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 | ||
content | ||
|
||
^ content |
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
...ages/MarkdownEditor-Core.package/MarkdownInlineTextStyler.class/instance/cutCloser.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,10 +1,10 @@ | ||
parsing | ||
cutCloser: closingMarkdownEmphasisDelimiter to: aLength | ||
cutCloser: closingMarkdownDelimiter to: aLength | ||
|
||
closingMarkdownEmphasisDelimiter length > aLength | ||
closingMarkdownDelimiter length > aLength | ||
ifTrue: [^ self tokens | ||
add: (closingMarkdownEmphasisDelimiter cutFromStart: aLength) asStringToken | ||
before: closingMarkdownEmphasisDelimiter] | ||
add: (closingMarkdownDelimiter cutFromStart: aLength) asStringToken | ||
before: closingMarkdownDelimiter] | ||
ifFalse: [^ self tokens | ||
at: (self tokens indexOf: closingMarkdownEmphasisDelimiter) | ||
put: closingMarkdownEmphasisDelimiter asStringToken] | ||
at: (self tokens indexOf: closingMarkdownDelimiter) | ||
put: closingMarkdownDelimiter asStringToken] |
4 changes: 0 additions & 4 deletions
4
packages/MarkdownEditor-Core.package/MarkdownInlineTextStyler.class/instance/emphases..st
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
packages/MarkdownEditor-Core.package/MarkdownInlineTextStyler.class/instance/emphases.st
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
...downEditor-Core.package/MarkdownInlineTextStyler.class/instance/findCloserFor.ifFound..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 @@ | ||
parsing | ||
findCloserFor: anOpener ifFound: foundBlock | ||
|
||
| nextTokens startIndex | | ||
startIndex := (self tokens indexOf: anOpener). | ||
nextTokens := self tokens copyFrom: startIndex to: self tokens size. | ||
nextTokens detect: [:token | | ||
token isDelimiter | ||
and: [token isCloser] | ||
and: [token matches: anOpener]] | ||
ifFound: [:match | ^ foundBlock value: match] | ||
ifNone: [] |
6 changes: 6 additions & 0 deletions
6
.../MarkdownEditor-Core.package/MarkdownInlineTextStyler.class/instance/followingTokenOf..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 @@ | ||
parsing - tokenization | ||
followingTokenOf: aMarkdownToken | ||
|
||
| token | | ||
token := self tokens after: aMarkdownToken ifAbsent: [^ MarkdownString new]. | ||
^ token |
3 changes: 3 additions & 0 deletions
3
...es/MarkdownEditor-Core.package/MarkdownInlineTextStyler.class/instance/inlineElements..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 @@ | ||
accessing | ||
inlineElements: anObject | ||
inlineElements := anObject |
3 changes: 3 additions & 0 deletions
3
...ges/MarkdownEditor-Core.package/MarkdownInlineTextStyler.class/instance/inlineElements.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 @@ | ||
accessing | ||
inlineElements | ||
^ inlineElements |
4 changes: 4 additions & 0 deletions
4
packages/MarkdownEditor-Core.package/MarkdownInlineTextStyler.class/instance/links..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 | ||
links: aCollectionOfMarkdownLinks | ||
|
||
links := aCollectionOfMarkdownLinks |
4 changes: 4 additions & 0 deletions
4
packages/MarkdownEditor-Core.package/MarkdownInlineTextStyler.class/instance/links.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 | ||
links | ||
|
||
^ links |
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,6 @@ parse: aString | |
clean; | ||
tokenize: aString; | ||
interpretTokens. | ||
^ self emphases | ||
|
||
^ self inlineElements | ||
|
6 changes: 6 additions & 0 deletions
6
.../MarkdownEditor-Core.package/MarkdownInlineTextStyler.class/instance/precedingTokenOf..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 @@ | ||
parsing - tokenization | ||
precedingTokenOf: aMarkdownToken | ||
|
||
| token | | ||
token := self tokens before: aMarkdownToken ifAbsent: [^ MarkdownString new]. | ||
^ token |
27 changes: 21 additions & 6 deletions
27
packages/MarkdownEditor-Core.package/MarkdownInlineTextStyler.class/instance/process.and..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,24 @@ | ||
parsing | ||
process: opener and: closer | ||
|
||
| length | | ||
self emphases add: (closer emphasisStartingAt: opener). | ||
self removeDelimitersBetween: opener and: closer. | ||
length := closer delimiterLengthForEmphasisWith: opener. | ||
self cutOpener: opener to: length. | ||
^ self cutCloser: closer to: length | ||
| length nextToken urlCloser | | ||
(opener class = MarkdownOpeningLinkDelimiter and: [closer class = MarkdownClosingLinkDelimiter]) | ||
ifTrue: [self inlineElements add: (closer linkStartingAt: opener). | ||
length := 1. | ||
nextToken := self followingTokenOf: closer. | ||
nextToken class = MarkdownOpeningURLDelimiter | ||
ifTrue: [urlCloser := self findCloserFor: nextToken ifFound: [:closingBracket | closingBracket]. | ||
(urlCloser = self or: [urlCloser isNil]) | ||
ifFalse: [self inlineElements last url: (self content copyFrom: nextToken startPosition + nextToken length to: urlCloser endPosition - urlCloser length). | ||
(self tokens copyFrom: (self tokens indexOf: nextToken) to: (self tokens indexOf: urlCloser)) | ||
select: [: token | token isDelimiter] | ||
thenDo: [:delimiter | | ||
self tokens at: (self tokens indexOf: delimiter) put: delimiter asStringToken]]]. | ||
self cutOpener: opener to: length. | ||
^ self cutCloser: closer to: length.] | ||
ifFalse: [ (opener class = MarkdownEmphasisDelimiter and: [closer class = MarkdownEmphasisDelimiter]) | ||
ifTrue: [ self inlineElements add: (closer emphasisStartingAt: opener). | ||
self removeDelimitersBetween: opener and: closer. | ||
length := closer delimiterLengthForEmphasisWith: opener. | ||
self cutOpener: opener to: length. | ||
^ self cutCloser: closer to: length]] |
Oops, something went wrong.