Improving splitting of admonition strings.
This commit is contained in:
parent
33f3a9a0c2
commit
5ccff44fc9
@ -21,6 +21,20 @@ ByteString >> admonitionBorders [
|
||||
^ response "copyWith: ':::'"
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
ByteString >> admonitionEndingPosition [
|
||||
| response |
|
||||
response := 0.
|
||||
self startsWithMarkdownAdmonition ifFalse: [ ^ response ].
|
||||
self lines do: [:line |
|
||||
response > 0 ifTrue: [ response := response + 1 ].
|
||||
(line trimBoth = ':::')
|
||||
ifFalse: [ response := response + line size ]
|
||||
ifTrue: [ response := response + line size. ]
|
||||
].
|
||||
^ response
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
ByteString >> email [
|
||||
"Quick fix for importing Lepiter pages that have a plain ByteString field as email."
|
||||
@ -58,3 +72,8 @@ ByteString >> markdownSplitted [
|
||||
response add: lastPart.
|
||||
^ response
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
ByteString >> startsWithMarkdownAdmonition [
|
||||
^ self admonitionBorders includes: self lines first trimBoth
|
||||
]
|
||||
|
@ -35,7 +35,8 @@ HedgeDoc >> asLePage [
|
||||
initializeTitle: self title.
|
||||
sanitizedMarkdown markdownSplitted do: [:lines | | snippet |
|
||||
snippet := LeTextSnippet new
|
||||
string: lines asStringWithCr.
|
||||
string: lines asStringWithCr;
|
||||
uid: LeUID new.
|
||||
newPage
|
||||
addSnippet: snippet;
|
||||
yourself
|
||||
|
Loading…
Reference in New Issue
Block a user