From 33f3a9a0c28f5b0fd469653a04c54d1e3ac447e1 Mon Sep 17 00:00:00 2001 From: Offray Date: Sun, 3 Nov 2024 15:06:58 -0500 Subject: [PATCH] Markdown crude semantic splits when converting to LePage. --- src/MiniDocs/HedgeDoc.class.st | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/MiniDocs/HedgeDoc.class.st b/src/MiniDocs/HedgeDoc.class.st index 2f03c29..c00666f 100644 --- a/src/MiniDocs/HedgeDoc.class.st +++ b/src/MiniDocs/HedgeDoc.class.st @@ -29,13 +29,17 @@ HedgeDoc class >> newDefault [ { #category : #accessing } HedgeDoc >> asLePage [ - | newPage snippet | - snippet := LeTextSnippet new - string: self bodyWithoutTitleHeader promoteMarkdownHeaders. + | newPage sanitizedMarkdown | + sanitizedMarkdown := self bodyWithoutTitleHeader promoteMarkdownHeaders. newPage := LePage new - initializeTitle: self title; - addSnippet: snippet; - yourself. + initializeTitle: self title. + sanitizedMarkdown markdownSplitted do: [:lines | | snippet | + snippet := LeTextSnippet new + string: lines asStringWithCr. + newPage + addSnippet: snippet; + yourself + ]. newPage incomingLinks. newPage options at: 'originalMetadata' put: self metadata;