jgm / jgm/commonmark-hs

Fenced div class parser is too strict

Open
#76 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
145
Forks
38
PR merge metrics
No merged PRs in 30d

Description

In [TailwindCSS](https://tailwindcss.com/), we have CSS class names like [`w-1/2`](https://tailwindcss.com/docs/width#class-reference) which trip up the fenced div parser.

Example,

```markdown
:::{.w-1/2}
Hello world
:::
```

A potential fix is to add `/` to the list here (any reason not to do that?)

https://github.com/jgm/commonmark-hs/blob/3d545d7afa6c91820b4eebf3efeeb80bf1b27128/commonmark-extensions/src/Commonmark/Extensions/Attributes.hs#L273

Tailwind classes can also contain a hyphen (eg: `md:w-auto`), so we might as well add `:`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.