Improving splitting of admonition strings.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2024-11-03 22:38:31 -05:00
parent 33f3a9a0c2
commit 5ccff44fc9
2 changed files with 21 additions and 1 deletions

View File

@ -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
]

View File

@ -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