Skip to content

Commit

Permalink
fix issues due to strict symbol comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
carolahp committed Dec 16, 2024
1 parent c6ed4ba commit 22be458
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Microdown/MicAbstractCodeBlock.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ MicAbstractCodeBlock class >> alternateBlockClassFor: line [

| tag |
tag := ((line allButFirst: CodeblockMarkup size)
copyUpTo: $|) trimBoth.
copyUpTo: $|) trimBoth asSymbol.
tag = #script ifTrue: [ ^ MicScriptBlock ].
^ MicScriptBlock allSubclasses detect: [ :each | each tag = tag ] ifNone: [ MicCodeBlock ]
]
Expand Down
2 changes: 1 addition & 1 deletion src/Microdown/MicArgumentList.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ MicArgumentList >> printOn: aStream [
self hasNonDefaultValue
ifTrue:[
aStream nextPutAll: self defaultValue.
argKeys := self keys copyWithout: self defaultArg.
argKeys := self keys copyWithout: self defaultArg asSymbol.
argKeys ifNotEmpty: [aStream nextPut: $|]]
ifFalse: [argKeys := self keys].
aStream nextPutAll: ((argKeys collect: [:k| k,'=',(self at:k)]) joinUsing: '&')
Expand Down
6 changes: 5 additions & 1 deletion src/Microdown/MicElement.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ MicElement class >> buildMicroDownUsing: aBuilder withComment: aComment [
{ #category : #utilities }
MicElement class >> extensionClassFor: tag [
"I am a utility method used in extension blocks to find the right subclass to instantiate"
^ self allSubclasses detect: [ :each | each tag = tag ] ifNone: [ self ]

| tagSymbol |

tagSymbol := tag asSymbol.
^ self allSubclasses detect: [ :each | each tag = tagSymbol ] ifNone: [ self ]
]

{ #category : #visiting }
Expand Down
2 changes: 1 addition & 1 deletion src/Microdown/MicResourceReference.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ MicResourceReference class >> fromUri: aString [
uri scheme
ifNil: [ ^ MicRelativeResourceReference new relativePath: aString ].
refClass := self allSubclasses
detect: [ :rc | rc handlesUriScheme: uri scheme ]
detect: [ :rc | rc handlesUriScheme: uri scheme asString ]
ifNone: [ MicUnknownResourceUri ].
^ refClass newFromUri: uri

Expand Down

0 comments on commit 22be458

Please sign in to comment.