Skip to content

Cannot invoke to_hash_ast on a KramDown::Document instance #435

@5t111111

Description

@5t111111

To convert Kramdown::Document to other formats, you can invoke implicitly defined methods (to_*) via method_missing implementation.

However, invoking to_hash_ast fails as hash_ast is camelize to HashAst under the hood, but there defines a class HashAST.

I think there are some possible solutions, but I am still not sure what is the best way to solve it:

  • Rename HashAST class to HashAst, but obviously it causes a breaking change
  • Define to_hash_ast explicitly, but it lacks consistency and DRY implmentation
  • Modify Kramdown::Utils.camelizeto support HasAST, but, umm it looks not good

I will consider to send a pull request If there's a solution you prefer.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions