[Discussion]: Preceding whitespace rule for verbatim ranged tags
Related: https://github.com/nvim-neorg/neorg/issues/946
We should have strict rule for ignoring preceding whitespaces in verbatim ranged tag content.
Example:
@code
text
text
@end
The expected verbatim ranged tag content should not include 2 spaces in each lines. This is crucial to embed indent-dependent languages like Python.
Idea
Follow the starting column of opening modifier (in this case, @code.)
Ignore same amount of whitespaces on content lines if there are any.
I'm not sure how we should handle tabs or zero/full-width spaces though.
Or we can just live without any special rules:
@code
text
text
@end
In this case, Neorg-like applications should implement some anticonceal characters to align the verbatim ranged tag content with its starting token (@code)
In what case would there be an indent before a verbatim ranged tag? If it's in a list, eg.
- @code
foo(bar)
@end
Isn't this already handled by list parsing logic?
@flexagoon v1 spec and parser didn't have same issue because verbatim ranged tag cannot be indented by its own:
- |
@code
foo(bar)
@end
slides/indent segments forced @code to come at the beginning of the line, without any prefix characters like - or >.
But in v2 spec, this is possible:
- @code
foo(bar)
@end
Which means now we have to set rule that can work for both - and .
Yeah v1 parser and neorg itself worked in similar way^1, but I couldn't found anything mentioned on specification. (v1 parser actually ignored the preceding whitespaces inside verbatim ranged tag. neorg did all heavy lift)
This is quite important because using column means we have specific width defined for \t character.
That's why I'm opening this issue to set standard in v2 spec.
There are also full-width space and zero-width space.