Jurgens du Toit | 17 Jul 2008 14:23
Picon
Gravatar

Syntax Questions

Hey :)

Is it a bug or a feature that the following two texts get formatted differently?

My shopping list
+ Bread
+ Milk
+ Cheese

My shopping list

+ Bread
+ Milk
+ Cheese

In the first one, the list doesn't get converted to an unordered list, while in the second, it does...


It occurs in both markdown and markdown extra, btw.

J

--
Website: www.jrgns.net

If people never did silly things, nothing intelligent would ever get done.
- Ludwig Wittgenstein
_______________________________________________
Markdown-Discuss mailing list
Markdown-Discuss <at> six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss
Aristotle Pagaltzis | 17 Jul 2008 15:31
Picon
Picon
Gravatar

Re: Syntax Questions

* Jurgens du Toit <jurgens.dutoit <at> gmail.com> [2008-07-17 14:25]:
> Is it a bug or a feature that the following two texts get
> formatted differently?

That’s on purpose. To make a list, it needs to be in a separate
paragraph.

Regards,
--

-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>
_______________________________________________
Markdown-Discuss mailing list
Markdown-Discuss <at> six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss
Daniel Winterstein | 17 Jul 2008 15:41
Picon
Gravatar

Markdown Editor plugin for Eclipse

Hello,

I'd like to announce an improved version of my Markdown Editor plugin
for the popular Eclipse Java + everything else IDE. The Markdown
plugin has moved from it's old location. The new location is:

http://winterwell.com/software/markdown-editor.php

There's syntax highlighting, a preview window, and it can export to
html. The best feature is the document outline, which is a joy for
editing large documents.
Plus you can use TODO tags and these get picked up as tasks, and an
emacs-style text formatting tool.

All the best,
 - Daniel

--

-- 
"I know nothing, understand less, & most of that is wrong."

 Daniel Winterstein
 Edinburgh
Jurgens du Toit | 17 Jul 2008 15:49
Picon
Gravatar

Re: Syntax Questions

Ok.

Is it possible to modify the code to do that? Can you point me in the right direction?

It's something I'd realy like to be able to do, even if it is a configurable options.

Another thing, is it possible to convert newlines to <br/> tags? I tried nl2br before and after passing the string to markdown, but either way there's to many br tags then.

Thanx!
J

On Thu, Jul 17, 2008 at 3:31 PM, Aristotle Pagaltzis <pagaltzis <at> gmx.de> wrote:
* Jurgens du Toit <jurgens.dutoit <at> gmail.com> [2008-07-17 14:25]:
> Is it a bug or a feature that the following two texts get
> formatted differently?

That's on purpose. To make a list, it needs to be in a separate
paragraph.

Regards,
--
Aristotle Pagaltzis // <http://plasmasturm.org/>
_______________________________________________
Markdown-Discuss mailing list
Markdown-Discuss <at> six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss



--
Website: www.jrgns.net

If people never did silly things, nothing intelligent would ever get done.
 - Ludwig Wittgenstein
_______________________________________________
Markdown-Discuss mailing list
Markdown-Discuss <at> six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss
John Gabriele | 17 Jul 2008 16:11
Picon

Re: Syntax Questions

On Thu, Jul 17, 2008 at 9:49 AM, Jurgens du Toit
<jurgens.dutoit <at> gmail.com> wrote:
> Ok.
>
> Is it possible to modify the code to do that?

Very probably, but you may not want to. My impression is that there's
a lot of tradeoffs in Markdown between it trying to do what you mean
and it requiring non-ambiguous markup. For example, if you've got a
paragraph with a plus sign in it, and you have your editor re-wrap it,
you might end up with a line starting with that plus sign. You
wouldn't want Markdown to think it's a one-item list.

It's also not terribly easy to read without that leading newline.

> Can you point me in the right
> direction?

You might look in the `_DoLists` function.

> It's something I'd realy like to be able to do, even if it is a configurable
> options.
>
> Another thing, is it possible to convert newlines to <br/> tags? I tried
> nl2br before and after passing the string to markdown, but either way
> there's to many br tags then.

You can end a line with 2 or more spaces and it will create a <br/> for you.

---John
Jurgens du Toit | 17 Jul 2008 20:12
Picon
Gravatar

Re: Syntax Questions



On Thu, Jul 17, 2008 at 4:11 PM, John Gabriele <jmg3000 <at> gmail.com> wrote:
On Thu, Jul 17, 2008 at 9:49 AM, Jurgens du Toit
<jurgens.dutoit <at> gmail.com> wrote:
> Ok.
>
> Is it possible to modify the code to do that?

Very probably, but you may not want to. My impression is that there's
a lot of tradeoffs in Markdown between it trying to do what you mean
and it requiring non-ambiguous markup. For example, if you've got a
paragraph with a plus sign in it, and you have your editor re-wrap it,
you might end up with a line starting with that plus sign. You
wouldn't want Markdown to think it's a one-item list.

I understand it to be tricky. I'll play around, and, if I don't like it, adapt and learn!


It's also not terribly easy to read without that leading newline.

> Can you point me in the right
> direction?

You might look in the `_DoLists` function.
Schweet, will do.


> It's something I'd realy like to be able to do, even if it is a configurable
> options.
>
> Another thing, is it possible to convert newlines to <br/> tags? I tried
> nl2br before and after passing the string to markdown, but either way
> there's to many br tags then.

You can end a line with 2 or more spaces and it will create a <br/> for you.

Didn't know that one, but, once again, not exactly what I want. Darn 'it, looks like I'll have to adapt...

Any special reason why single newlines don't get converted to <br/>? I'm thinking that if it happens right at the end of the manipulations, and newlines between closing and opening block tags (such as <\p>\n<p>) get ignored, it will work? Or, actually more simple, only newlines between certain tags, such as p and div?

J


---John
_______________________________________________
Markdown-Discuss mailing list
Markdown-Discuss <at> six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss



--
Jurgens du Toit
Cell: +27 83 511 7932
Fax: +27 86 503 2637
Website: www.jrgns.net

If people never did silly things, nothing intelligent would ever get done.
- Ludwig Wittgenstein
_______________________________________________
Markdown-Discuss mailing list
Markdown-Discuss <at> six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss
Jan Erik Moström | 17 Jul 2008 22:00
Picon

Re: Syntax Questions

Jurgens du Toit <jurgens.dutoit <at> gmail.com> 08-07-17 20.12

>Any special reason why single newlines don't get converted to <br/>? I'm
>thinking that if it happens right at the end of the manipulations, and
>newlines between closing and opening block tags (such as <\p>\n<p>) get
>ignored, it will work? Or, actually more simple, only newlines between
>certain tags, such as p and div?

I'm not sure I understand, do you mean that you want a text like this:

This is just
an example
text

to be translated into

<p>
This is just<br/>
an example<br/>
text<br/>
</p>

Or am I misunderstanding things?

                 jem
--

-- 
Jan Erik Moström, www.mostrom.pp.se
Jurgens du Toit | 17 Jul 2008 22:13
Picon
Gravatar

Re: Syntax Questions

Exactly that, yes.

On Thu, Jul 17, 2008 at 10:00 PM, Jan Erik Moström <lists <at> mostrom.pp.se> wrote:
Jurgens du Toit <jurgens.dutoit <at> gmail.com> 08-07-17 20.12


Any special reason why single newlines don't get converted to <br/>? I'm
thinking that if it happens right at the end of the manipulations, and
newlines between closing and opening block tags (such as <\p>\n<p>) get
ignored, it will work? Or, actually more simple, only newlines between
certain tags, such as p and div?

I'm not sure I understand, do you mean that you want a text like this:

This is just
an example
text

to be translated into

<p>
This is just<br/>
an example<br/>
text<br/>
</p>

Or am I misunderstanding things?

               jem
--
Jan Erik Moström, www.mostrom.pp.se


_______________________________________________
Markdown-Discuss mailing list
Markdown-Discuss <at> six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss



--
Jurgens du Toit
Cell: +27 83 511 7932
Fax: +27 86 503 2637
Website: www.jrgns.net

If people never did silly things, nothing intelligent would ever get done.
- Ludwig Wittgenstein
_______________________________________________
Markdown-Discuss mailing list
Markdown-Discuss <at> six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss
Jan Erik Moström | 17 Jul 2008 22:41
Picon

Re: Syntax Questions

Jurgens du Toit <jurgens.dutoit <at> gmail.com> 08-07-17 22.13

>Exactly that, yes.

Well, there is a good reason why Markdown doesn't do this. Many 
prefer to use a plain text editor which doesn't wrap text (I for 
example prefer my text files this way) and we insert hard new 
lines to keep the lines from becoming too long. If those hard 
newlines were translated into <br /> Markdown would be useless 
for a lot of people.

(and I don't think there is an option to get it to behave the 
way you want)

                 jem
--

-- 
Jan Erik Moström, www.mostrom.pp.se
Michel Fortin | 18 Jul 2008 03:49
Gravatar

Re: Syntax Questions

Le 2008-07-17 à 10:11, John Gabriele a écrit :

> On Thu, Jul 17, 2008 at 9:49 AM, Jurgens du Toit
> <jurgens.dutoit <at> gmail.com> wrote:
>> Ok.
>>
>> Is it possible to modify the code to do that?
>
> Very probably, but you may not want to. My impression is that there's
> a lot of tradeoffs in Markdown between it trying to do what you mean
> and it requiring non-ambiguous markup. For example, if you've got a
> paragraph with a plus sign in it, and you have your editor re-wrap it,
> you might end up with a line starting with that plus sign. You
> wouldn't want Markdown to think it's a one-item list.

Well, that's almost the exact reason this was changed, a long time ago
now. The problem was with sentences finishing with a number in the
middle of a hard-wrapped paragraph. For instance, I could say: "I want
2. He wants 3.", and then you'd have a strange list popping in the
middle of your otherwise normal paragraph.

The requirement of a blank line goes away when a list is nested in
another, so you can write nice-looking hierarchical lists:

     1.  Test
         *   Test
         *   Test

Michel Fortin
michel.fortin <at> michelf.com
http://michelf.com/

Gmane