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"