Improved AutoLinkEmail (Fletcher Penney). [jgm/peg-markdown]
See https://github.com/jgm/peg-markdown/commit/ca4df46
This commit is contained in:
parent
95b1be5f7e
commit
5f0135f259
@ -31,7 +31,7 @@ const (
|
||||
// rebuild it using
|
||||
// make nuke
|
||||
// make parser
|
||||
needParserIfaceVersion = parserIfaceVersion_11
|
||||
needParserIfaceVersion = parserIfaceVersion_12
|
||||
)
|
||||
|
||||
// Markdown Options:
|
||||
|
@ -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, "")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user