[ANN] vfmd

Roopesh Chander roop at forwardbias.in
Tue Oct 1 08:15:59 EDT 2013


I think I was being biased towards the expandtab-way of text editing, in my
previous mails on this topic. Thinking from the point of view of a
keep-tabs-as-tabs text editor, another solution becomes possible, which I
describe below:

This is how the user documentation would look like:
--- snip ---
The list bullet char should be followed by one or more spaces or a tab
character.

For multi-paragraph list items, the subsequent paragraphs should be
indented to vertically align with the first paragraph of the list item,
using either spaces or a tab. If you are using tabs for indentation, you
should use the same number of tab characters to indent all paragraphs of
the list item, including the first paragraph.
--- snip ---

The parser would operate as follows:
--- snip ---
- Let t be the number of tab characters occurring after the bullet
character of a list item
- If t > 0, then
- First, look for t tab characters (with optional interspersed spaces) as
indentation for subsequent paragraphs
- If previous step didn't match, look for tabs+spaces as indentation
using the modulo-4 method
- If t = 0, then
- Look for tabs+spaces as indentation using the modulo-4 method
--- snip ---

Advantage:
- If the user doesn't mix space-indentation and tab-indentation, it would
work for almost all cases (see below for the not-working case),
irrespective of the tabstop setting he uses
- If the user uses space-indentation in some parts of the list and
tab-indentation in other parts of the list, things are only as bad as the
modulo-4 method

Disadvantage:
- Even if the user doesn't mix space-indentation and tab-indentation, it
doesn't work for the case where the (number of spaces before the bullet
char) = (tabstop - 1). For example, with tabstop=4 (_ being tab and . being
space):

...*____list item para 1

________list item para 2

will be parsed unintuitively. This is why the user documentation above
says: "If you are using tabs for indentation, you should use the same
number of tab characters to indent all paragraphs of the list item,
including the first paragraph."

What are your thoughts on this option?

roop.


On Mon, Sep 30, 2013 at 7:56 PM, Roopesh Chander <roop at forwardbias.in>wrote:


>

> On Mon, Sep 30, 2013 at 7:54 PM, Roopesh Chander <roop at forwardbias.in>wrote:

>

>> To summarize:

>> - Marked always replaces '\t' with 4 spaces

>> - Maruku and Kramdown keep the '\t' intact

>> - Everyone else does the "4-(column_number modulo 4)" method

>>

>

> Not Marked. I meant Maruku. Sorry about the typo.

>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://six.pairlist.net/pipermail/markdown-discuss/attachments/20131001/c145f1ef/attachment.html>


More information about the Markdown-Discuss mailing list