-
Notifications
You must be signed in to change notification settings - Fork 32
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 #844 from pillar-markup/lineBreak
Line break
- Loading branch information
Showing
23 changed files
with
239 additions
and
258 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
src/Microdown-Macrodown/MicMicrodownObjectToPillarObjectConverter.extension.st
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
src/Microdown-NewMacrodown/MacMicrodownSharedPool.class.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,33 @@ | ||
" | ||
I do not know how to integrate the new delimiter in a modular way because | ||
``` | ||
MicInlineDelimiter class >> initializeDelimiters | ||
self = MicInlineDelimiter ifFalse: [ ^ self ]. | ||
DelimiterDictionary := Dictionary new. | ||
self allSubclasses do: [ :class | class initializeDelimiters ] | ||
``` | ||
is basically doing is currently taking all the different subclasses. | ||
The solution would be to have an explicit registration so that we can say | ||
`MicInlineDelimiter useStandard` or `useExtendedSets`. | ||
This has to be done if there is an interest. | ||
" | ||
Class { | ||
#name : 'MacMicrodownSharedPool', | ||
#superclass : 'SharedPool', | ||
#classVars : [ | ||
'InlineParagraphDelimiter' | ||
], | ||
#category : 'Microdown-NewMacrodown', | ||
#package : 'Microdown-NewMacrodown' | ||
} | ||
|
||
{ #category : 'class initialization' } | ||
MacMicrodownSharedPool class >> initialize [ | ||
|
||
InlineParagraphDelimiter := ' '. | ||
] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
" | ||
This class is copied as it was from Macrodown package. | ||
In particular I do not really get how the plain HTML is detected. It is a new top level block or an inline block? | ||
It looks like the MacrodownParser is doing the following: | ||
``` | ||
blockStarterClassFrom: line | ||
self flag: #HACK. ""This is a special case because it collides with environment"" | ||
(MacRawParagraphBlock matchesComment: line) | ||
ifTrue: [ ^ self nonMatchedBlockClassFor: line ]. | ||
^ super blockStarterClassFrom: line | ||
``` | ||
It would have been nice to know it. I would have changed the syntax for environment. | ||
A raw paragraph block is a block that containes raw content (e.g. plain HTML) | ||
" | ||
Class { | ||
#name : 'MacRawParagraphBlock', | ||
#superclass : 'MicParagraphBlock', | ||
#category : 'Microdown-NewMacrodown', | ||
#package : 'Microdown-NewMacrodown' | ||
} | ||
|
||
{ #category : 'visiting' } | ||
MacRawParagraphBlock >> accept: aVisitor [ | ||
|
||
^ aVisitor visitRawParagraph: self | ||
] | ||
|
||
{ #category : 'parse support' } | ||
MacRawParagraphBlock >> closeMe [ | ||
|
||
self children: { | ||
MicRawBlock | ||
from: 1 | ||
to: text size | ||
withSubstring: text } | ||
] |
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
24 changes: 24 additions & 0 deletions
24
src/Microdown-NewMacrodown/MicInlineTokenStreamTest.extension.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,24 @@ | ||
Extension { #name : 'MicInlineTokenStreamTest' } | ||
|
||
{ #category : '*Microdown-NewMacrodown' } | ||
MicInlineTokenStreamTest >> testLineBreak [ | ||
|
||
| src tokens | | ||
self skip. | ||
src := 'aa bb'. | ||
tokens := (MicInlineTokenStream on: src) contents. | ||
self assert: tokens size equals: 3. | ||
self assert: tokens second string equals: ' ' | ||
] | ||
|
||
{ #category : '*Microdown-NewMacrodown' } | ||
MicInlineTokenStreamTest >> testLineBreakBackSlashed [ | ||
|
||
| src tokens | | ||
self skip. | ||
src := 'aa\ bb'. | ||
tokens := (MicInlineTokenStream on: src) contents. | ||
self assert: tokens size equals: 1. | ||
"to me it should not lose the / but we will see this later." | ||
self assert: tokens first string equals: 'aa bb' | ||
] |
Oops, something went wrong.