You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Details
Atx headings are allowed to have spaces before the starting `#`
according to the spec. Probably not common but we should be able to
handle this properly.
To fix this replaced the level calculation of `#text` which is the text
width including spaces, with a more complicated calculation that uses
the length of the lua pattern match `^%s*(#+)` or 0. This capture will
result in the leading hashtags minus any leading space. Put this in the
`str` module and used wherever heading level logic was needed.
Also replaced use of `nil` with conditions where possible. The lua
`fail` is technically subject to change so avoiding checks on `nil`
directly is the more robust approach.
0 commit comments