News for hackers. Stuff that matters.
Re:Show HN: Margin – A lightweight, flexible markup language... by vlmutolo on Sunday May 10, 2020 @10:21PM (#23138295)
This looks really interesting. For a “casual coder”, I think you did a good job designing the spec for a new markup language. That’s not easy.

One weird edge case I’m thinking about: what happens if you have two lines, A and B, and A is indented with a tab and B is indented with 3 spaces? Is A the parent of B?

More generally: how do you compare tabs and spaces in the context of indentation levels?

Re:Show HN: Margin – A lightweight, flexible markup language... by nobody_nothing on Monday May 11, 2020 @12:13AM (#23138849)
This is a great question and something I've pondered. I recently learned that mixing tabs and space in certain Python environments, such Google Cloud Functions, simply isn't allowed -- uploading such code will cause an error.

Unfortunately, that might be the cleanest solution for Margin, too: to simply disallow the intermingling of tabs and spaces as hierarchical tokens within a single parent.

In that scenario, you could use tabs in one part of the document and spaces in the other -- as long as all the direct children of one parent item follow the same rules.

Re:Show HN: Margin – A lightweight, flexible markup language... by tobr on Monday May 11, 2020 @03:34AM (#23139729)
What if you would just be a little bit stricter and say that each level of indentation is either 1 tab or 2 spaces? 3 spaces is then interpreted as one level of indentation of an item starting with a space.