[TxMt] Extra indentation in Markdown mode

Dr. Drang drdrang at gmail.com
Wed Mar 1 06:29:49 UTC 2006


On 2/28/06, Charilaos Skiadas <cskiadas at uchicago.edu> wrote:

> I can explain what is happening and suggest some ideas on how to fix
> it. The scope for the entire markdown bundle is text.html.markdown
> This means that it inherits stuff from the html bundle, in general a
> good thing. In this case, it inherits the indentPattern behavior,
> that you would see for instance if you type <html> and press enter.

[snip]

> I think what you have to do is create such a file in the Markdown
> bundle, with an appropriate increase indent pattern and scope
> text.html.markdown, and hope that this will override the pattern from
> html. The problem with that of course is that then the html indenting
> will not work in markdown.
>
> I don't think that there is a simple answer here, in that we do want
> such indenting in markdown in general, and in fact in code blocks
> too, since the code blocks might often be html. It just happens to
> have this weird behavior if your code happens to have what looks like
> the opening of an html tag.

Haris, I hope you're getting paid for the good work you do on this
list. You seem to be helping out in every thread.

I haven't thought about this issue before, but I think I'm going to
disagree with your last paragraph. Certainly we'd all like indenting
in our code blocks, but I don't think HTML code should get special
treatment in TM because it doesn't get special treatment in Markdown
itself. I suppose I wouldn't mind if this special treatment of HTML
were benign, but it isn't: it messes up the input of other types of
code.

Should Markdown be inheriting from HTML? My tendency is to say no.
Markdown is not a subset or superset of HTML; it is something
different. Yes, you can insert HTML directly (outside of a code block)
when Markdown itself can't give you what you want, but those
insertions are usually very short. I don't think TM's Markdown mode
benefits from this inheritance.

--
Dr. Drang



More information about the textmate mailing list