Skip to content
This repository has been archived by the owner on May 22, 2023. It is now read-only.

Commit

Permalink
(#10) Controller: fix invalid url for URI.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas Schulte committed May 11, 2015
1 parent e31183d commit 9ba3ddb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
## Last Changes


- [#10](https://github.com/LaxarJS/ax-markdown-display-widget/issues/10): fixed invalid url for URI.js

## v1.6.1

- [#9](https://github.com/LaxarJS/ax-markdown-display-widget/issues/9): fixed log warnings
Expand Down
13 changes: 11 additions & 2 deletions ax-markdown-display-widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,11 @@ define( [
return defaultRenderer.image( href, title, text );
}
else {
return defaultRenderer.image( uri.unicode().absoluteTo( markdownUrl() ), title, text );
var markdownSourceUrl = markdownUrl();
if( !markdownSourceUrl ) {
return defaultRenderer.image( uri.unicode(), title, text );
}
return defaultRenderer.image( uri.unicode().absoluteTo( markdownSourceUrl ), title, text );
}
}

Expand All @@ -154,7 +158,11 @@ define( [
return '<a href="' + anchorHref + '">' + text + '</a>';
}
else {
return defaultRenderer.link( uri.unicode().absoluteTo( markdownUrl() ), title, text );
var markdownSourceUrl = markdownUrl();
if( !markdownSourceUrl ) {
return defaultRenderer.link( uri.unicode(), title, text );
}
return defaultRenderer.link( uri.unicode().absoluteTo( markdownSourceUrl ), title, text );
}
}
}
Expand Down Expand Up @@ -189,6 +197,7 @@ define( [
} );

function scrollToAnchor( id ) {
if( !id ) { return; }
var offset = $( '#' + id ).offset();
if( offset ) {
window.scrollTo( offset.left, offset.top );
Expand Down

0 comments on commit 9ba3ddb

Please sign in to comment.