From a2aa7b546d5977e6756d22c803d81b303894998f Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Mon, 10 Nov 2014 12:29:33 +0000 Subject: [PATCH] Sync before moving (myself) from location. --- repository/Grafoscopio/GrafoscopioNode.class.st | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/repository/Grafoscopio/GrafoscopioNode.class.st b/repository/Grafoscopio/GrafoscopioNode.class.st index 5850591..e2eb518 100644 --- a/repository/Grafoscopio/GrafoscopioNode.class.st +++ b/repository/Grafoscopio/GrafoscopioNode.class.st @@ -106,7 +106,7 @@ GrafoscopioNode >> asMarkdown [ markdownOutput := '' writeStream. (self preorderTraversal) do: [ :eachNode | (eachNode level > 0) ifTrue: [ - (eachNode ancestorsHeaders includes: '%invisible') not + (eachNode hasAncestorWith: '%invisible') not ifTrue: [ markdownOutput nextPutAll: (eachNode markdownContent) ]]]. ^markdownOutput contents @@ -193,6 +193,15 @@ GrafoscopioNode >> demote [ ] +{ #category : #exporting } +GrafoscopioNode >> hasAncestorWith: aSpecialWord [ + "Looks if the receptor node has an ancestor with a header with 'aSpecialWord' as the only or the first word" + + ^ (self ancestorsHeaders includes: aSpecialWord) | ((self ancestorsHeaders collect: [:eachHeader | (eachHeader findTokens: $ ) at: 1 ]) includes: aSpecialWord) + + +] + { #category : #accessing } GrafoscopioNode >> header [ "Returns the receiver header"