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