Skip to content

nil error #1024

@kasperosterbye

Description

@kasperosterbye

If I write this:

Microdown asRichText: 'A`nil`C'.

An error occurs in MicSemanticAction >> #getTagOrNil

getTagOrNil
	| tagName |
	tagName := tokens first asSymbol.
	self class packageOrganizer packages do: [ :package |
		(tagName beginsWith: package name) ifTrue: [
....

Because tokens first is nil, not the letters "nil".
And nil does not understand asSymbol.

Changing the method to

getTagOrNil
	| tagName |
	tokens first ifNil: [ ^ entity := nil ]. "Added this line..."
	tagName := tokens first asSymbol.
	self class packageOrganizer packages do: [ :package |
		(tagName beginsWith: package name) ifTrue: [
....

Makes it work, and the result of Microdown asRichText: 'AnilC'. is then: "AnilC".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions