File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 13
13
- added support for `HEAD` method
14
14
- fixed file routing
15
15
- added support for handling specific file extensions in the form `ROUTE('FILE *.php', ...)`
16
+ - improved parsing `<links>` in the markdown parser
16
17
17
18
========================
18
19
0.0.13
Original file line number Diff line number Diff line change @@ -107,8 +107,19 @@ function markdown_keywords(value) {
107
107
}
108
108
109
109
function markdown_links2 ( value ) {
110
+
110
111
value = value . substring ( 4 , value . length - 4 ) ;
111
- return '<a href="' + ( value . isEmail ( ) ? 'mailto:' : REG_LINKEXTERNAL . test ( value ) ? '' : 'http://' ) + value + '" target="_blank">' + value + '</a>' ;
112
+
113
+ let url = value ;
114
+
115
+ if ( value . isEmail ( ) )
116
+ url = 'mailto:' + value ;
117
+ else if ( value . isPhone ( ) )
118
+ url = 'tel:' + value ;
119
+ else if ( ! REG_LINKEXTERNAL . test ( value ) )
120
+ url = 'http://' + url ;
121
+
122
+ return '<a href="' + url + '" target="_blank">' + value + '</a>' ;
112
123
}
113
124
114
125
function markdown_format ( value , index , text ) {
You can’t perform that action at this time.
0 commit comments