denoland / deno-gfm

Server-side GitHub Flavored Markdown rendering for Deno
https://jsr.io/@deno/gfm
MIT License
226 stars 37 forks source link

fix: yaml is correctly highlighted #96

Closed deer closed 4 months ago

deer commented 9 months ago

closes https://github.com/denoland/deno-gfm/issues/60

Sadly prism doesn't offer an easy way to import languages, so I've just hacked it in by doing:

import "https://esm.sh/prismjs@1.29.0/components/prism-yaml";

The testing strategy I was pursuing needed a major refactor, which I've done here. It's now significantly easier to add server cases. Additionally, you can now easily visually inspect the test cases by running deno task server. This currently produces the following output:

# Deno GFM Server Tests

[basicMarkdownTable](http://localhost:8000/basicMarkdownTable)
[yaml](http://localhost:8000/yaml)

I think the highlighting on the yaml case can be improved. Please let me know what I should be doing in main.scss to improve this.

deer commented 9 months ago

Waiting on https://github.com/denoland/deno-gfm/pull/99, so that this PR is focused purely on YAML, instead of also redoing the testing infrastructure.

deer commented 9 months ago

@hashrock and @crowlKats, what do you think about this one? On the positive side, it highlights yaml better than we currently do. On the negative side, it might not be right in all cases and if the user doesn't want yaml highlighting, there's no way to opt out. I'd say the positives outweigh the negatives though.

Mrashes commented 4 months ago

@deer I agree positives outweigh the negatives. It would be a positive addition to the package if added, also contributes to the goal of it all working out the box.