Before solving the problem with '%invisible' nodes.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2014-11-06 18:24:21 +00:00 committed by SantiagoBragagnolo
parent 2e7ad8f6b9
commit 6522e11153
1 changed files with 9 additions and 7 deletions

View File

@ -253,7 +253,7 @@ GrafoscopioNode >> markdownContent [
| markdown configDict specialWords embedNodes temporalBody |
markdown := '' writeStream.
specialWords := #('%config' '%abstract' '%invisible' '%idea' '%footnote' 'nuevoNodo' '%embed').
(self level > 0) & (specialWords includes: self header) not & (specialWords includes: ((self header findTokens: $ ) at: 1)) not
(self level > 0) & (specialWords includes: self header) not & (specialWords includes: ((self header findTokens: $ ) at: 1)) not
ifTrue: [
self level timesRepeat: [ markdown nextPutAll: '#' ].
markdown nextPutAll: ' '.
@ -273,18 +273,20 @@ GrafoscopioNode >> markdownContent [
markdown nextPutAll: 'abstract: ', '|'; lf; nextPutAll: (configDict at: 'abstract'); lf.
markdown nextPutAll: '---'; lf. ].
((self header findString: '%idea') = 1)
ifTrue: ["markdown nextPutAll: (self body contents withInternetLineEndings); lf; lf."
embedNodes := self children select: [:each | ((each header findTokens: $ ) at: 1) = '%embed'].
temporalBody := self body.
embedNodes ifNotNil: [ embedNodes do: [ :each | temporalBody := temporalBody copyReplaceAll: (each header) with: each body]].
markdown nextPutAll: (temporalBody contents withUnixLineEndings); lf; lf.
ifTrue: [
embedNodes := self children select: [:each | ((each header findTokens: $ ) at: 1) = '%embed'].
temporalBody := self body.
embedNodes ifNotNil: [ embedNodes do: [ :each | temporalBody := temporalBody copyReplaceAll: (each header) with: each body]].
markdown nextPutAll: (temporalBody contents withUnixLineEndings); lf; lf.
].
((self header findString: '%footnote') = 1)
ifTrue: [
markdown nextPutAll: ('[^',(self header copyReplaceAll: '#footnote ' with: ''),']: ' ); lf.
markdown nextPutAll: ('[^',(self header copyReplaceAll: '%footnote ' with: ''),']: ' ); lf.
markdown nextPutAll: (self body contents withInternetLineEndings); lf; lf. ].
((self header findString: '%embed') = 1)
ifTrue: [ ].
(self header = '%invisible')
ifTrue: [ ].
^markdown contents
]