jgm / djot

A light markup language
https://djot.net
MIT License
1.67k stars 43 forks source link

div blocks don't allow underscores in class names #64

Closed matklad closed 1 year ago

matklad commented 1 year ago
[inline]{.a_b_c}

::: a_b_c

:::

I'd expect both a_b_c to parse as a class name. The second one doesn't:

doc
  para
    span class="a_b_c"
      str s="inline"
  para
    str s="::: a"
    emph
      str s="b"
    str s="c"
  div
references = {
}
footnotes = {
}
matklad commented 1 year ago

And the second problem is English bias (which I think is OK for attributes, but still):

::: блок
:::

It seems reasonable to just allow anything between whitespace perhaps?

bpj commented 1 year ago

Not English bias but ASCII/byte string bias, and its a limitation of Lua patterns so unavoidable in a Lua implementation if you want to avoid some hefty C dependency.