Fixing Markdown importation for simple cases.
This commit is contained in:
parent
babbd48934
commit
d470dd533c
@ -33,9 +33,20 @@ HedgeDoc >> asLePage [
|
||||
sanitizedMarkdown := self bodyWithoutTitleHeader promoteMarkdownHeaders.
|
||||
newPage := LePage new
|
||||
initializeTitle: self title.
|
||||
sanitizedMarkdown markdownSplitted do: [:lines | | snippet |
|
||||
sanitizedMarkdown := sanitizedMarkdown markdownSplitted.
|
||||
sanitizedMarkdown class = OrderedCollection ifTrue: [
|
||||
sanitizedMarkdown do: [:lines | | snippet |
|
||||
snippet := LeTextSnippet new
|
||||
string: lines asStringWithCr;
|
||||
uid: LeUID new.
|
||||
newPage
|
||||
addSnippet: snippet;
|
||||
yourself
|
||||
]
|
||||
].
|
||||
sanitizedMarkdown class = ByteString ifTrue: [ | snippet |
|
||||
snippet := LeTextSnippet new
|
||||
string: lines asStringWithCr;
|
||||
string: sanitizedMarkdown;
|
||||
uid: LeUID new.
|
||||
newPage
|
||||
addSnippet: snippet;
|
||||
@ -159,7 +170,7 @@ HedgeDoc >> server: aUrlString [
|
||||
|
||||
{ #category : #accessing }
|
||||
HedgeDoc >> url [
|
||||
^ url asUrl
|
||||
url ifNotNil: [ ^ url asUrl ]
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
|
@ -293,17 +293,19 @@ LePage >> sharedVariablesBindings [
|
||||
{ #category : #'*MiniDocs' }
|
||||
LePage >> splitAdmonitionSnippets [
|
||||
"I'm used to clean after importing from HedgeDoc to ensure that a snippet contains only admonitions and extra content is put in a new cell."
|
||||
(self children select: [:node | node string startsWithMarkdownAdmonition ])
|
||||
do: [:node | | nodeContent |
|
||||
node ifNotNil: [
|
||||
nodeContent := node string.
|
||||
nodeContent startsWithMarkdownAdmonition
|
||||
ifTrue: [ | snippetCommand |
|
||||
| admonitionSnippets |
|
||||
admonitionSnippets := self children select: [:node | node string startsWithMarkdownAdmonition ].
|
||||
admonitionSnippets ifEmpty: [ ^ self ].
|
||||
admonitionSnippets do: [:node | | nodeContent |
|
||||
node ifNotNil: [
|
||||
nodeContent := node string.
|
||||
nodeContent startsWithMarkdownAdmonition
|
||||
ifTrue: [ | snippetCommand |
|
||||
snippetCommand := node splitSnippetCommandAtPosition: nodeContent admonitionEndingPosition.
|
||||
snippetCommand execute
|
||||
]
|
||||
snippetCommand execute
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
{ #category : #'*MiniDocs' }
|
||||
|
Loading…
Reference in New Issue
Block a user