Berengar | 1 Feb 2011 13:34
Picon
Picon

Enabeling E-Mail Name

Dear readers,

of the Markdown-(Extra)-Discussion list. After including Markdown as the Markup language of choice for
my 
configuration files I stumbled over a feature I was missing: Adding e-mail links with names. I came up with a 
little hack I want to share with you.

Old Syntax: (mailto:$mailadress <at> $mailhost)
New Syntax: (mailto:$mailadress <at> $mailhost[ My Name)

changes:
1) function doAutoLinks: insert '(?:\W*(.*))' in RegEx before the '>' line
2) function _doAutoLinks_email_callback: insert '$text = $matches[3];' before line starting with
$link = ...
3) function encodeEmailAdress:
  a) change signature to ($addr, $text)
  b) wrap the line starting with $text = ... so it reads 'if ($text  == "") { $text = ... }'

pretty easy, istn't it?

Greetings,
Berengar
David Parsons | 1 Feb 2011 16:04
Picon
Favicon

Re: Enabeling E-Mail Name


On Feb 1, 2011, at 4:34 AM, Berengar wrote:

> Dear readers,
>
> of the Markdown-(Extra)-Discussion list. After including Markdown as  
> the Markup language of choice for my
> configuration files I stumbled over a feature I was missing: Adding  
> e-mail links with names. I came up with a
> little hack I want to share with you.
>
> Old Syntax: (mailto:$mailadress <at> $mailhost)
> New Syntax: (mailto:$mailadress <at> $mailhost[ My Name)

     How is this better than the traditional [name](mailto:address)  
syntax?

   -david parsons
Arno Hautala | 1 Feb 2011 16:30
Favicon
Gravatar

Re: Enabeling E-Mail Name

On Tue, Feb 1, 2011 at 07:34, Berengar <Berengar.Lehr <at> gmx.de> wrote:
>
> changes:
> 1) function doAutoLinks: insert '(?:\W*(.*))' in RegEx before the '>' line
> 2) function _doAutoLinks_email_callback: insert '$text = $matches[3];' before line starting with
$link = ...
> 3) function encodeEmailAdress:
>  a) change signature to ($addr, $text)
>  b) wrap the line starting with $text = ... so it reads 'if ($text  == "") { $text = ... }'

You also need to pass $text to encodeEmailAddress in the callback.

> New Syntax: (mailto:$mailadress <at> $mailhost[ My Name)

I don't know if I mistyped something in applying your edits, or
there's something wrong in the "New Syntax", but it didn't work when I
tried this.

> pretty easy, istn't it?

A patch would have been easier and more fool proof.

What would be a beneficial addition, would be adding email obfuscation
capabilities to the [text](email) syntax. Currently the only way to
achieve obfuscation is with the <email> syntax.

--

-- 
arno  s  hautala    /-|   arno <at> alum.wpi.edu

pgp b2c9d448
(Continue reading)

Arno Hautala | 1 Feb 2011 16:43
Favicon
Gravatar

Email Obfuscation Techniques

The other thread brought to my attention that only the <email> syntax
obfuscates mailto links. Plus, while the entity encoding technique
probably fools some scrapers, I doubt it's all that effective. Even
Gruber uses the Hivelogic Enkoder [1].

So, what are people using for obfuscation and are you using any
scripting or automation (filter that takes a pass before or after
Markdown) to get this into your HTML?

[1]: hivelogic.com/enkoder

--

-- 
arno  s  hautala    /-|   arno <at> alum.wpi.edu

pgp b2c9d448
_______________________________________________
Markdown-Discuss mailing list
Markdown-Discuss <at> six.pairlist.net
http://six.pairlist.net/mailman/listinfo/markdown-discuss
Berengar | 1 Feb 2011 23:07
Picon
Picon

Re: Enabeling E-Mail Name

I'm sorry,

I chose the <>-Syntax because of obfuscation even so I would also use
[]() if it would provide obfuscation, but two notations for linking exis
and I don't want to be the one to decide whether to let one go.

I didn't realize that the changes would really be build in instantly.
Otherwise I would have provided an diff. You are right, the call to
encodeEmailAddress in function _doAutoLinks_email_callback should be
changed according to the functions new signature. (Attached the diff file)

I like the obfuscation it has now because it does not need JS. Anyone
who needs some advanced obfuscation technique should implement it in JS
which is beyond the focus of markdown.

Good night,
Berengar Lehr

Am 01.02.2011 16:30, schrieb Arno Hautala:
> On Tue, Feb 1, 2011 at 07:34, Berengar <Berengar.Lehr <at> gmx.de> wrote:
>>
>> changes:
>> 1) function doAutoLinks: insert '(?:\W*(.*))' in RegEx before the '>' line
>> 2) function _doAutoLinks_email_callback: insert '$text = $matches[3];' before line starting with
$link = ...
>> 3) function encodeEmailAdress:
>>  a) change signature to ($addr, $text)
>>  b) wrap the line starting with $text = ... so it reads 'if ($text  == "") { $text = ... }'
> 
> You also need to pass $text to encodeEmailAddress in the callback.
(Continue reading)

weakish | 8 Feb 2011 11:44
Picon
Gravatar

two lists without separating text (corner case?)

First we consider two lists with different type:

- foo
- bar

1. first
1. second

There are two interceptions:

a. one unordered list
b. one unordered list followed by one ordered list

Implementations conforming to a:

- Markdown.pl
- Python Markdown
- BlueCloth
- MarkdownJ
- markdown.lua, 
- Showdown

Implementations conforming to b:

- PHP Markdown
- Text::Markdown
- Maruku
- Pandoc
- Discount
- PEG Markdown
(Continue reading)

weakish | 8 Feb 2011 16:01
Picon
Gravatar

Re: two lists without separating text (corner case?)

weakish <weakish <at> gmail.com> writes:

> What's more, if we intercept this as one list,
> then how can we write two lists without separating
> text in markdown?  I've no idea except using HTML:
> 
> - apple
> - orange
> <!-- Dear Markdown: I want two lists. -->
> * John
> * Jane

This idea just came to my mind:
use empty blockquote or code span:

- apple
- orange

><SPC>

* John
* Jane

` `     

+ foo
+ bar

This works in all markdown implementation.

(Continue reading)

David Parsons | 8 Feb 2011 16:03
Picon
Favicon

Re: two lists without separating text (corner case?)


On Feb 8, 2011, at 2:44 AM, weakish wrote:

> First we consider two lists with different type:
>
> - foo
> - bar
>
> 1. first
> 1. second
>
> There are two interceptions:
>
> a. one unordered list
> b. one unordered list followed by one ordered list

     I guess the question is just how often will you
     write two separate lists in a row without some
     intermediate commentary?   It doesn't seem like
     it would flow all that naturally.

     -david parsons
Joseph Lorenzo Hall | 9 Feb 2011 01:05
Picon

Re: two lists without separating text (corner case?)

Yeah, I've faced this with writing recipes where I have a ul of
ingredients and then a ol of steps to cook the dish. But just putting
"Directions:" between the two is easy enough. best, Joe

--

-- 
Joseph Lorenzo Hall
ACCURATE Postdoctoral Research Associate
UC Berkeley School of Information
Princeton Center for Information Technology Policy
http://josephhall.org/
weakish | 9 Feb 2011 14:29
Picon
Gravatar

code span doesn't preserve space

Consider this code span: `grep '    '`.  All implementations listed on
[babelmark](http://babelmark.bobtfish.net) just simply wrap it as:

    <code>grep '    '</code>

Viewed in browsers, the above code is equivalent to:

    <code>grep ' '</code>

I think spaces should be preserved in code span,which maintains consistence
with code block.  For example, the following HTML code:

    <code>grep '&nbsp;&nbsp;&nbsp; '</code> 

Gmane