Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Code Highlighting #35

Closed
solomonhawk opened this issue May 6, 2020 · 2 comments
Closed

Code Highlighting #35

solomonhawk opened this issue May 6, 2020 · 2 comments

Comments

@solomonhawk
Copy link

solomonhawk commented May 6, 2020

I haven't used the Cmark parser before with ExDoc but I tried it because Earmark doesn't support formatting markdown nested inside html tags. Cmark does, but my output has no code highlighting.

Is this expected?

All I've done is add {:cmark, "~> 0.7"} to my deps, add markdown_processor: ExDoc.Markdown.Cmark, and build the docs. You can see the result below:

image

I'm happy to provide additional information if it's helpful!

Thanks

@josevalim
Copy link
Collaborator

This is more of an issue with ExDoc, as it is the one doing code highlighting. However, note that we removed Cmark support on master, because future ExDoc versions will work with the markdown AST, so I am afraid you don't really have a long term option at the moment.

@solomonhawk
Copy link
Author

@josevalim Understood. I can feel myself grasping at straws at the moment trying to find a workable solution.

I'm hopeful that Earmark will eventually solve this in order to resolve pragdave/earmark#228. It's a tricky problem, but marking html elements with a special attribute to opt-in to nested markdown parsing seems like a sane path forward.

In the meantime I will explore writing a custom transformer to do this and if successful will try to share that around.

I expanded on my use case in the issue on the earmark repo.

Thanks as usual for all that you continue to do for this lovely community, José.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants