File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -135,19 +135,24 @@ class MdToHtml {
135
135
if ( isResourceUrl && ! this . supportsResourceLinks_ ) {
136
136
// In mobile, links to local resources, such as PDF, etc. currently aren't supported.
137
137
// Ideally they should be opened in the user's browser.
138
- return '<span style="opacity: 0.5">(Resource not yet supported: ' ; //+ htmlentities(text) + ']';
138
+ return '<span style="opacity: 0.5">(Resource not yet supported: ' ;
139
139
} else {
140
140
let resourceIdAttr = "" ;
141
141
let icon = "" ;
142
+ let hrefAttr = '#' ;
142
143
if ( isResourceUrl ) {
143
144
const resourceId = Resource . pathToId ( href ) ;
144
145
href = "joplin://" + resourceId ;
145
146
resourceIdAttr = "data-resource-id='" + resourceId + "'" ;
146
147
icon = '<span class="resource-icon"></span>' ;
148
+ } else {
149
+ // If the link is a plain URL (as opposed to a resource link), set the href to the actual
150
+ // link. This allows the link to be exported too when exporting to PDF.
151
+ hrefAttr = href ;
147
152
}
148
153
149
154
const js = options . postMessageSyntax + "(" + JSON . stringify ( href ) + "); return false;" ;
150
- let output = "<a " + resourceIdAttr + " title='" + htmlentities ( title ) + "' href='# ' onclick='" + js + "'>" + icon ;
155
+ let output = "<a " + resourceIdAttr + " title='" + htmlentities ( title ) + "' href='" + hrefAttr + " ' onclick='" + js + "'>" + icon ;
151
156
return output ;
152
157
}
153
158
}
You can’t perform that action at this time.
0 commit comments