Skip to content

Commit

Permalink
Merge pull request #1 from braydonf/dirs
Browse files Browse the repository at this point in the history
Fix replacing links in a directory.
  • Loading branch information
pnagurny committed Sep 29, 2015
2 parents a7ed30c + af6d269 commit e56152a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/FixLinks.js
@@ -1,5 +1,5 @@
module.exports = function FixLinks( data , callback) {
var regex = / href=\"(\w+)\.md\"/mig;
var regex = / href=\"([A-Za-z0-9_\/]+)\.md\"/mig;
data.content = data.content.replace( regex , ' href="$1.html"');
callback( null , data );
};
2 changes: 1 addition & 1 deletion test/fixtures/input.js
@@ -1,3 +1,3 @@
var example = '<p>You can also instantiate an Address from a String, <a href="publickey.md">PublicKey</a>, or <a href="hierarchical.html">HDPublicKey</a>, in case you are not the owner of the private key.</p>';
var example = '<p>You can also instantiate an Address from a String, <a href="publickey.md">PublicKey</a>, or <a href="hierarchical.html">HDPublicKey</a>, in case you are not the owner of the private key.</p><ul><li><ul><li><a href="services/address.md">Services</a></li></ul></li></ul>';

module.exports = example;
2 changes: 1 addition & 1 deletion test/fixtures/output.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e56152a

Please sign in to comment.