Closes #457
@@ -2598,7 +2598,9 @@ showdown.subParser('anchors', function (text, options, globals) {
result += ' title="' + title + '"';
}
- if (options.openLinksInNewWindow) {
+ // optionLinksInNewWindow only applies
+ // to external links. Hash links (#) open in same page
+ if (options.openLinksInNewWindow && !/^#/.test(url)) {
// escaped _
result += ' target="¨E95Eblank"';
@@ -44,7 +44,9 @@ showdown.subParser('anchors', function (text, options, globals) {
@@ -0,0 +1 @@
+<p>this link is in the <a href="#same-page">same page</a></p>
+this link is in the [same page](#same-page)