Improved AutoLinkEmail (Fletcher Penney). [jgm/peg-markdown]

See https://github.com/jgm/peg-markdown/commit/ca4df46
This commit is contained in:
Michael Teichgräber 2012-04-30 10:10:32 +02:00
parent 95b1be5f7e
commit 5f0135f259
3 changed files with 4 additions and 4 deletions

View File

@ -31,7 +31,7 @@ const (
// rebuild it using
// make nuke
// make parser
needParserIfaceVersion = parserIfaceVersion_11
needParserIfaceVersion = parserIfaceVersion_12
)
// Markdown Options:

View File

@ -28,7 +28,7 @@ import (
)
const (
parserIfaceVersion_11 = iota
parserIfaceVersion_12 = iota
)
// Semantic value of a parsing action.
@ -632,7 +632,7 @@ AutoLink = AutoLinkUrl | AutoLinkEmail
AutoLinkUrl = '<' < [A-Za-z]+ "://" ( !Newline !'>' . )+ > '>'
{ $$ = p.mkLink(p.mkString(yytext), yytext, "") }
AutoLinkEmail = '<' < [-A-Za-z0-9+_]+ '@' ( !Newline !'>' . )+ > '>'
AutoLinkEmail = '<' ( "mailto:" )? < [-A-Za-z0-9+_./!%~$]+ '@' ( !Newline !'>' . )+ > '>'
{
$$ = p.mkLink(p.mkString(yytext), "mailto:"+yytext, "")
}

2
portid
View File

@ -1 +1 @@
173
174