From 8ada5ba381ef130449aae1a4cf71b8c89173c1da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phaneDucasse?= Date: Mon, 23 Sep 2024 10:18:34 +0200 Subject: [PATCH] Revert "Line break" --- src/Microdown-Macrodown/MacConstants.class.st | 18 +++++ .../MacInlineParser.class.st | 55 ++++++++++++++ .../MacLineBreakBlock.class.st} | 14 ++-- .../MacLineBreakDelimiter.class.st | 76 +++++++++++++++++++ .../MacMailtoResourceReference.class.st} | 11 ++- .../MacParagraphBlock.class.st | 11 +-- .../MacRawParagraphBlock.class.st | 53 +++++++++++++ .../MacrodownParser.class.st | 4 +- .../MicAbstractDelimiter.extension.st | 13 ++++ ...ObjectToPillarObjectConverter.extension.st | 13 ++++ .../MicrodownVisitor.extension.st | 12 +++ .../MacMicrodownSharedPool.class.st | 33 -------- .../MacRawParagraphBlock.class.st | 44 ----------- .../MicInlineTokenStreamTest.extension.st | 24 ------ .../MicParagraphWithDoubleSpaceTest.class.st | 25 ------ .../NoteForStef.class.st | 59 -------------- src/Microdown-NewMacrodown/package.st | 1 - .../MicInlineParserTest.class.st | 12 --- .../MicAbstractDelimiter.class.st | 4 - ...downObjectToPillarObjectConverter.class.st | 3 - .../MicInlineStandardDelimiter.class.st | 6 -- src/Microdown/MicInlineTokenStream.class.st | 1 - src/Microdown/MicMicrodownSharedPool.class.st | 5 -- 23 files changed, 258 insertions(+), 239 deletions(-) create mode 100644 src/Microdown-Macrodown/MacConstants.class.st create mode 100644 src/Microdown-Macrodown/MacInlineParser.class.st rename src/{Microdown-NewMacrodown/MicLineBreakBlock.class.st => Microdown-Macrodown/MacLineBreakBlock.class.st} (50%) create mode 100644 src/Microdown-Macrodown/MacLineBreakDelimiter.class.st rename src/{Microdown/MicMailtoResourceReference.class.st => Microdown-Macrodown/MacMailtoResourceReference.class.st} (55%) rename src/{Microdown-NewMacrodown => Microdown-Macrodown}/MacParagraphBlock.class.st (80%) create mode 100644 src/Microdown-Macrodown/MacRawParagraphBlock.class.st rename src/{Microdown-NewMacrodown => Microdown-Macrodown}/MacrodownParser.class.st (92%) create mode 100644 src/Microdown-Macrodown/MicAbstractDelimiter.extension.st create mode 100644 src/Microdown-Macrodown/MicMicrodownObjectToPillarObjectConverter.extension.st create mode 100644 src/Microdown-Macrodown/MicrodownVisitor.extension.st delete mode 100644 src/Microdown-NewMacrodown/MacMicrodownSharedPool.class.st delete mode 100644 src/Microdown-NewMacrodown/MacRawParagraphBlock.class.st delete mode 100644 src/Microdown-NewMacrodown/MicInlineTokenStreamTest.extension.st delete mode 100644 src/Microdown-NewMacrodown/MicParagraphWithDoubleSpaceTest.class.st delete mode 100644 src/Microdown-NewMacrodown/NoteForStef.class.st delete mode 100644 src/Microdown-NewMacrodown/package.st diff --git a/src/Microdown-Macrodown/MacConstants.class.st b/src/Microdown-Macrodown/MacConstants.class.st new file mode 100644 index 00000000..601ee713 --- /dev/null +++ b/src/Microdown-Macrodown/MacConstants.class.st @@ -0,0 +1,18 @@ +" +Constants to be used on the extended parser. +" +Class { + #name : 'MacConstants', + #superclass : 'SharedPool', + #classVars : [ + 'InlineParagraphDelimiter' + ], + #category : 'Microdown-Macrodown', + #package : 'Microdown-Macrodown' +} + +{ #category : 'initialization' } +MacConstants class >> initialize [ + + InlineParagraphDelimiter := ' ' +] diff --git a/src/Microdown-Macrodown/MacInlineParser.class.st b/src/Microdown-Macrodown/MacInlineParser.class.st new file mode 100644 index 00000000..2ea214ff --- /dev/null +++ b/src/Microdown-Macrodown/MacInlineParser.class.st @@ -0,0 +1,55 @@ +" +Inline parser to detect and parse extended parse functionality. + +- line break with two (or more) spaces. +" +Class { + #name : 'MacInlineParser', + #superclass : 'MicInlineParser', + #pools : [ + 'MacConstants' + ], + #category : 'Microdown-Macrodown', + #package : 'Microdown-Macrodown' +} + +{ #category : 'adding' } +MacInlineParser >> addLineBreakInlineBlock: indexOfAssociateOpener [ + | startIndex endIndex | + + startIndex := opener index + opener size. + endIndex := string indexOf: Character cr startingAt: startIndex. + (endIndex = 0 + or: [ (endIndex - startIndex) = 0 ]) + ifTrue: [ ^ self ]. + + self + addInlineBlock: indexOfAssociateOpener + from: startIndex + to: endIndex +] + +{ #category : 'private' } +MacInlineParser >> extentedDelimiters [ + + ^ { MacLineBreakDelimiter } +] + +{ #category : 'actions' } +MacInlineParser >> identifyMarkupFor: aString [ + + ^ self extentedDelimiters + detect: [ :each | each matches: aString ] + ifFound: [ :aDelimiterClass | + delimiterClass := aDelimiterClass. + aDelimiterClass applyOn: self ] + ifNone: [ super identifyMarkupFor: aString ] +] + +{ #category : 'applying' } +MacInlineParser >> processLineBreak [ + + self delimiterFoundProcess. + self addInlineBlock: (self findType: delimiterClass type). + ^ result last text size +] diff --git a/src/Microdown-NewMacrodown/MicLineBreakBlock.class.st b/src/Microdown-Macrodown/MacLineBreakBlock.class.st similarity index 50% rename from src/Microdown-NewMacrodown/MicLineBreakBlock.class.st rename to src/Microdown-Macrodown/MacLineBreakBlock.class.st index 3b77f4e7..3b70293a 100644 --- a/src/Microdown-NewMacrodown/MicLineBreakBlock.class.st +++ b/src/Microdown-Macrodown/MacLineBreakBlock.class.st @@ -2,32 +2,32 @@ Block to process line breaks. " Class { - #name : 'MicLineBreakBlock', + #name : 'MacLineBreakBlock', #superclass : 'MicInlineElement', - #category : 'Microdown-NewMacrodown', - #package : 'Microdown-NewMacrodown' + #category : 'Microdown-Macrodown', + #package : 'Microdown-Macrodown' } { #category : 'visiting' } -MicLineBreakBlock >> accept: aVisitor [ +MacLineBreakBlock >> accept: aVisitor [ ^ aVisitor visitLineBreak: self ] { #category : 'accessing' } -MicLineBreakBlock >> kind [ +MacLineBreakBlock >> kind [ ^ #lineBreak ] { #category : 'accessing' } -MicLineBreakBlock >> openingDelimiter [ +MacLineBreakBlock >> openingDelimiter [ ^ nil ] { #category : 'accessing' } -MicLineBreakBlock >> openingDelimiterSize [ +MacLineBreakBlock >> openingDelimiterSize [ ^ 0 ] diff --git a/src/Microdown-Macrodown/MacLineBreakDelimiter.class.st b/src/Microdown-Macrodown/MacLineBreakDelimiter.class.st new file mode 100644 index 00000000..130e82b4 --- /dev/null +++ b/src/Microdown-Macrodown/MacLineBreakDelimiter.class.st @@ -0,0 +1,76 @@ +" +Delimiter definition for line break. +" +Class { + #name : 'MacLineBreakDelimiter', + #superclass : 'MicAbstractDelimiter', + #category : 'Microdown-Macrodown', + #package : 'Microdown-Macrodown' +} + +{ #category : 'applying' } +MacLineBreakDelimiter class >> applyOn: inlineParser [ + + ^ inlineParser processLineBreak +] + +{ #category : 'accessing' } +MacLineBreakDelimiter class >> associatedInlineBlock [ + + ^ MacLineBreakBlock +] + +{ #category : 'accessing' } +MacLineBreakDelimiter class >> isCloser [ + + ^ true +] + +{ #category : 'accessing' } +MacLineBreakDelimiter class >> isOpener [ + + ^ true +] + +{ #category : 'accessing' } +MacLineBreakDelimiter class >> markup [ + + ^ #lineBreak +] + +{ #category : 'testing' } +MacLineBreakDelimiter class >> matches: aString [ + | indexOfCr | + + (aString size >= 3) ifFalse: [ ^ false ]. + + indexOfCr := (aString indexOf: Character cr) - 1. + indexOfCr < 2 ifTrue: [ ^ false ]. + + ^ (aString first: indexOfCr) allSatisfy: [ :each | each = Character space ] +] + +{ #category : 'accessing' } +MacLineBreakDelimiter class >> size [ + + ^ 1 +] + +{ #category : 'accessing' } +MacLineBreakDelimiter class >> type [ + + ^ #lineBreak +] + +{ #category : 'adding' } +MacLineBreakDelimiter >> addInlineBlock: anIndex to: inlineParser [ + + inlineParser addLineBreakInlineBlock: anIndex + +] + +{ #category : 'accessing' } +MacLineBreakDelimiter >> endIndex [ + + ^ self index + self size +] diff --git a/src/Microdown/MicMailtoResourceReference.class.st b/src/Microdown-Macrodown/MacMailtoResourceReference.class.st similarity index 55% rename from src/Microdown/MicMailtoResourceReference.class.st rename to src/Microdown-Macrodown/MacMailtoResourceReference.class.st index d67b3146..beddf805 100644 --- a/src/Microdown/MicMailtoResourceReference.class.st +++ b/src/Microdown-Macrodown/MacMailtoResourceReference.class.st @@ -2,20 +2,19 @@ Definition of ""mailto"" scheme (to let the links recognise it). " Class { - #name : 'MicMailtoResourceReference', + #name : 'MacMailtoResourceReference', #superclass : 'MicAbsoluteResourceReference', - #category : 'Microdown-Macro', - #package : 'Microdown', - #tag : 'Macro' + #category : 'Microdown-Macrodown', + #package : 'Microdown-Macrodown' } { #category : 'instance creation' } -MicMailtoResourceReference class >> handlesUriScheme: scheme [ +MacMailtoResourceReference class >> handlesUriScheme: scheme [ ^ scheme beginsWith: 'mailto' ] { #category : 'accessing' } -MicMailtoResourceReference >> contents [ +MacMailtoResourceReference >> contents [ ^ self error: 'Should not arrive here?' ] diff --git a/src/Microdown-NewMacrodown/MacParagraphBlock.class.st b/src/Microdown-Macrodown/MacParagraphBlock.class.st similarity index 80% rename from src/Microdown-NewMacrodown/MacParagraphBlock.class.st rename to src/Microdown-Macrodown/MacParagraphBlock.class.st index daa11ac5..8431f9c7 100644 --- a/src/Microdown-NewMacrodown/MacParagraphBlock.class.st +++ b/src/Microdown-Macrodown/MacParagraphBlock.class.st @@ -1,8 +1,5 @@ " -This class is copied as it was from Macrodown package. - Paragraph extension to process the extended inlines. - " Class { #name : 'MacParagraphBlock', @@ -11,10 +8,10 @@ Class { 'textWithoutBreak' ], #pools : [ - 'MacMicrodownSharedPool' + 'MacConstants' ], - #category : 'Microdown-NewMacrodown', - #package : 'Microdown-NewMacrodown' + #category : 'Microdown-Macrodown', + #package : 'Microdown-Macrodown' } { #category : 'parising' } @@ -26,7 +23,7 @@ MacParagraphBlock >> addLineAndReturnNextNode: line [ (line endsWith: InlineParagraphDelimiter) ifFalse: [ ^ self ]. "add nodes up to now, then insert break and continue" children addAll: (self inlineParse: textWithoutBreak). - children add: MicLineBreakBlock new. + children add: (MacLineBreakBlock new). textWithoutBreak := nil ] diff --git a/src/Microdown-Macrodown/MacRawParagraphBlock.class.st b/src/Microdown-Macrodown/MacRawParagraphBlock.class.st new file mode 100644 index 00000000..7db25fa9 --- /dev/null +++ b/src/Microdown-Macrodown/MacRawParagraphBlock.class.st @@ -0,0 +1,53 @@ +" +A raw paragraph block is a block that containes raw content (e.g. plain HTML) +" +Class { + #name : 'MacRawParagraphBlock', + #superclass : 'MicParagraphBlock', + #category : 'Microdown-Macrodown', + #package : 'Microdown-Macrodown' +} + +{ #category : 'private' } +MacRawParagraphBlock class >> htmlTags [ + + ^ #('!--' 'a' 'abbr' 'address' 'area' 'article' 'aside' 'audio' 'b' 'base' 'bdi' 'bdo' 'blockquote' 'body' 'br' 'button' 'canvas' 'caption' 'cite' 'code' 'col' 'colgroup' 'data' 'datalist' 'dd' 'del' 'details' 'dfn' 'dialog' 'div' 'dl' 'dt' 'em' 'embed' 'fieldset' 'figcaption' 'figure' 'footer' 'form' 'h1' 'h2' 'h3' 'h4' 'h5' 'h6' 'head' 'header' 'hgroup' 'hr' 'html' 'i' 'iframe' 'img' 'input' 'ins' 'kbd' 'label' 'legend' 'li' 'link' 'main' 'map' 'mark' 'menu' 'meta' 'meter' 'nav' 'noscript' 'object' 'ol' 'optgroup' 'option' 'output' 'p' 'param' 'picture' 'pre' 'progress' 'q' 'rb' 'rp' 'rt' 'rtc' 'ruby' 's' 'samp' 'script' 'section' 'select' 'slot' 'small' 'source' 'span' 'strong' 'style' 'sub' 'summary' 'sup' 'table' 'tbody' 'td' 'template' 'textarea' 'tfoot' 'th' 'thead' 'time' 'title' 'tr' 'track' 'u' 'ul' 'var' 'video' 'wbr') +] + +{ #category : 'testing' } +MacRawParagraphBlock class >> matches: aString [ + + ^ self matches: aString trimLeft withAnyOf: self htmlTags +] + +{ #category : 'private' } +MacRawParagraphBlock class >> matches: aString withAnyOf: htmlTags [ + + aString ifEmpty: [ ^ false ]. + ^ (aString first = $<) + and: [ htmlTags includes: (aString readStream upToAnyOf: '> ') allButFirst ] +] + +{ #category : 'testing' } +MacRawParagraphBlock class >> matchesComment: aString [ + + ^ self + matches: aString trimLeft + withAnyOf: { self htmlTags first } +] + +{ #category : 'visiting' } +MacRawParagraphBlock >> accept: aVisitor [ + + ^ aVisitor visitRawParagraph: self +] + +{ #category : 'parse support' } +MacRawParagraphBlock >> closeMe [ + + self children: { + MicRawBlock + from: 1 + to: text size + withSubstring: text } +] diff --git a/src/Microdown-NewMacrodown/MacrodownParser.class.st b/src/Microdown-Macrodown/MacrodownParser.class.st similarity index 92% rename from src/Microdown-NewMacrodown/MacrodownParser.class.st rename to src/Microdown-Macrodown/MacrodownParser.class.st index 0aced97e..a91b598f 100644 --- a/src/Microdown-NewMacrodown/MacrodownParser.class.st +++ b/src/Microdown-Macrodown/MacrodownParser.class.st @@ -4,8 +4,8 @@ This is a variation of the MicrodownParser that tries to be as close as possible Class { #name : 'MacrodownParser', #superclass : 'MicrodownParser', - #category : 'Microdown-NewMacrodown', - #package : 'Microdown-NewMacrodown' + #category : 'Microdown-Macrodown', + #package : 'Microdown-Macrodown' } { #category : 'public' } diff --git a/src/Microdown-Macrodown/MicAbstractDelimiter.extension.st b/src/Microdown-Macrodown/MicAbstractDelimiter.extension.st new file mode 100644 index 00000000..7ab0d971 --- /dev/null +++ b/src/Microdown-Macrodown/MicAbstractDelimiter.extension.st @@ -0,0 +1,13 @@ +Extension { #name : 'MicAbstractDelimiter' } + +{ #category : '*Microdown-Macrodown' } +MicAbstractDelimiter classSide >> applyOn: inlineParser [ + + self subclassResponsibility +] + +{ #category : '*Microdown-Macrodown' } +MicAbstractDelimiter classSide >> matches: aString [ + + ^ false +] diff --git a/src/Microdown-Macrodown/MicMicrodownObjectToPillarObjectConverter.extension.st b/src/Microdown-Macrodown/MicMicrodownObjectToPillarObjectConverter.extension.st new file mode 100644 index 00000000..ed19d8c0 --- /dev/null +++ b/src/Microdown-Macrodown/MicMicrodownObjectToPillarObjectConverter.extension.st @@ -0,0 +1,13 @@ +Extension { #name : 'MicMicrodownObjectToPillarObjectConverter' } + +{ #category : '*Microdown-Macrodown' } +MicMicrodownObjectToPillarObjectConverter >> visitLineBreak: aBreak [ + + ^ PRLineBreak new +] + +{ #category : '*Microdown-Macrodown' } +MicMicrodownObjectToPillarObjectConverter >> visitRawParagraph: aRawParagraph [ + + ^ PRRaw content: aRawParagraph text +] diff --git a/src/Microdown-Macrodown/MicrodownVisitor.extension.st b/src/Microdown-Macrodown/MicrodownVisitor.extension.st new file mode 100644 index 00000000..e5dc523a --- /dev/null +++ b/src/Microdown-Macrodown/MicrodownVisitor.extension.st @@ -0,0 +1,12 @@ +Extension { #name : 'MicrodownVisitor' } + +{ #category : '*Microdown-Macrodown' } +MicrodownVisitor >> visitLineBreak: aBreak [ + +] + +{ #category : '*Microdown-Macrodown' } +MicrodownVisitor >> visitRawParagraph: aRawParagraph [ + + ^ self visitChildrenOf: aRawParagraph +] diff --git a/src/Microdown-NewMacrodown/MacMicrodownSharedPool.class.st b/src/Microdown-NewMacrodown/MacMicrodownSharedPool.class.st deleted file mode 100644 index bb49d2f5..00000000 --- a/src/Microdown-NewMacrodown/MacMicrodownSharedPool.class.st +++ /dev/null @@ -1,33 +0,0 @@ -" -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 := ' '. -] diff --git a/src/Microdown-NewMacrodown/MacRawParagraphBlock.class.st b/src/Microdown-NewMacrodown/MacRawParagraphBlock.class.st deleted file mode 100644 index f1d44a7b..00000000 --- a/src/Microdown-NewMacrodown/MacRawParagraphBlock.class.st +++ /dev/null @@ -1,44 +0,0 @@ -" -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 } -] diff --git a/src/Microdown-NewMacrodown/MicInlineTokenStreamTest.extension.st b/src/Microdown-NewMacrodown/MicInlineTokenStreamTest.extension.st deleted file mode 100644 index b3ac68e9..00000000 --- a/src/Microdown-NewMacrodown/MicInlineTokenStreamTest.extension.st +++ /dev/null @@ -1,24 +0,0 @@ -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' -] diff --git a/src/Microdown-NewMacrodown/MicParagraphWithDoubleSpaceTest.class.st b/src/Microdown-NewMacrodown/MicParagraphWithDoubleSpaceTest.class.st deleted file mode 100644 index 3addd2ab..00000000 --- a/src/Microdown-NewMacrodown/MicParagraphWithDoubleSpaceTest.class.st +++ /dev/null @@ -1,25 +0,0 @@ -Class { - #name : 'MicParagraphWithDoubleSpaceTest', - #superclass : 'TestCase', - #pools : [ - 'MicMicrodownSharedPool' - ], - #category : 'Microdown-NewMacrodown', - #package : 'Microdown-NewMacrodown' -} - -{ #category : 'running' } -MicParagraphWithDoubleSpaceTest >> testTwoSingleLinesWithSpaces [ - | root paragraph | - self skip. - root := MacrodownParser parse: 'This is -a paragraph on two lines, separated by two spaces'. - self assert: root children size equals: 1. - paragraph := root children first. - - self assert: paragraph children first text equals: 'This is'. - self assert: paragraph children second class equals: MicLineBreakBlock. - self assert: paragraph children third text equals: 'a paragraph on two lines, separated by two spaces'. - self assert: paragraph text equals: 'This is -a paragraph on two lines, separated by two spaces' -] diff --git a/src/Microdown-NewMacrodown/NoteForStef.class.st b/src/Microdown-NewMacrodown/NoteForStef.class.st deleted file mode 100644 index b52570f0..00000000 --- a/src/Microdown-NewMacrodown/NoteForStef.class.st +++ /dev/null @@ -1,59 +0,0 @@ -" -from https://markdownguide.offshoot.io/basic-syntax/ - -## About line breaks - -Line Breaks -To create a line break or new line (
), end a line with two or more spaces, and then type return. - -Markdown HTML Rendered Output -This is the first line. -And this is the second line.

This is the first line.
-And this is the second line.

-This is the first line. -And this is the second line. - -Line Break Best Practices -You can use two or more spaces (commonly referred to as “trailing whitespace”) for line breaks in nearly every Markdown application, but it’s controversial. It’s hard to see trailing whitespace in an editor, and many people accidentally or intentionally put two spaces after every sentence. For this reason, you may want to use something other than trailing whitespace for line breaks. If your Markdown application supports HTML, you can use the
HTML tag. - -For compatibility, use trailing white space or the
HTML tag at the end of the line. - -There are two other options I don’t recommend using. CommonMark and a few other lightweight markup languages let you type a backslash (\) at the end of the line, but not all Markdown applications support this, so it isn’t a great option from a compatibility perspective. And at least a couple lightweight markup languages don’t require anything at the end of the line — just type return and they’ll create a line break. - -✅ Do this ❌ Don't do this -First line with two spaces after. -And the next line. - -First line with the HTML tag after.
-And the next line. - -First line with a backslash after.\ -And the next line. - -First line with nothing after. -And the next line. - -### Stef summary - -We could have anything else than double spaces (which is the worse design idea ever) may be
- -### About Raw Paragraph - -There is comment in blockStarterClassFrom: -that says that environment conflicts with raw HTML but
> testItalic_UnclompletedNested [ { (MicTextBlock new bodyString: 'aa~bbbbcc') }) printString ] -{ #category : 'tests break' } -MicInlineParserTest >> testLineBreak [ - - | blocks | - blocks := self inlineParse: 'x1 -x2 -'. - - self assert: blocks size equals: 3. - self assert: blocks second class equals: MicLineBreakBlock -] - { #category : 'test generated' } MicInlineParserTest >> testLink [ "Auto generated by self class>>#generateUrlTests" diff --git a/src/Microdown-ToHelpMacrodownLoading/MicAbstractDelimiter.class.st b/src/Microdown-ToHelpMacrodownLoading/MicAbstractDelimiter.class.st index 81168eb0..1e2fa72a 100644 --- a/src/Microdown-ToHelpMacrodownLoading/MicAbstractDelimiter.class.st +++ b/src/Microdown-ToHelpMacrodownLoading/MicAbstractDelimiter.class.st @@ -1,7 +1,3 @@ -" -This is an old class from Microdown v1. - -" Class { #name : 'MicAbstractDelimiter', #superclass : 'Object', diff --git a/src/Microdown-ToHelpMacrodownLoading/MicMicrodownObjectToPillarObjectConverter.class.st b/src/Microdown-ToHelpMacrodownLoading/MicMicrodownObjectToPillarObjectConverter.class.st index 64f19e9e..78bc5c4a 100644 --- a/src/Microdown-ToHelpMacrodownLoading/MicMicrodownObjectToPillarObjectConverter.class.st +++ b/src/Microdown-ToHelpMacrodownLoading/MicMicrodownObjectToPillarObjectConverter.class.st @@ -1,6 +1,3 @@ -" -This is an old class from old Macrodown. -" Class { #name : 'MicMicrodownObjectToPillarObjectConverter', #superclass : 'Object', diff --git a/src/Microdown/MicInlineStandardDelimiter.class.st b/src/Microdown/MicInlineStandardDelimiter.class.st index a61e587b..b28602bb 100644 --- a/src/Microdown/MicInlineStandardDelimiter.class.st +++ b/src/Microdown/MicInlineStandardDelimiter.class.st @@ -43,12 +43,6 @@ MicInlineStandardDelimiter class >> initializeDelimiters [ self new markup: RawOpenerMarkup; blockClass: MicRawBlock; closer: RawCloserMarkup; addMe. self new markup: RawCloserMarkup; blockClass: nil; closer: nil; addMe. - "Line breaks" - "Double space are used in macrodown to split paragraphs in two paragraphs. Now - this is feature will break existing texts so disable it for now - self new markup: InlineParagraphDelimiter ; blockClass: MicLineBreakBlock ; closer: nil; addMe. - " - "Containing URLs" self new markup: LinkNameOpenerMarkup; blockClass: MicLinkBlock; closer: NameCloserUrlOpener; addMe. self new markup: FigureNameOpenerMarkup; blockClass: MicFigureBlock; closer: NameCloserUrlOpener; addMe. diff --git a/src/Microdown/MicInlineTokenStream.class.st b/src/Microdown/MicInlineTokenStream.class.st index f3599ffe..cbc560ef 100644 --- a/src/Microdown/MicInlineTokenStream.class.st +++ b/src/Microdown/MicInlineTokenStream.class.st @@ -110,7 +110,6 @@ MicInlineTokenStream >> addText: matchedString [ { #category : 'initialization' } MicInlineTokenStream >> initialize [ - super initialize. tokens := OrderedCollection new ] diff --git a/src/Microdown/MicMicrodownSharedPool.class.st b/src/Microdown/MicMicrodownSharedPool.class.st index 4876bd0c..49f4d243 100644 --- a/src/Microdown/MicMicrodownSharedPool.class.st +++ b/src/Microdown/MicMicrodownSharedPool.class.st @@ -27,7 +27,6 @@ Class { 'FixiousTextDelimiter', 'HeaderMarkup', 'HorizontalLineMarkup', - 'InlineParagraphDelimiter', 'ItalicMarkup', 'LinkNameCloserMarkup', 'LinkNameOpenerMarkup', @@ -70,10 +69,6 @@ MicMicrodownSharedPool class >> initialize [ EnvironmentOpeningBlockMarkup := '