Permalink
Browse files

#42 Specify text of a hyper link when using the createLink command

  • Loading branch information...
1 parent 5979a9e commit 9fe6182de9021a5179fcb4d49dcfd21a6dd30766 @jhollingworth jhollingworth committed Apr 15, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/commands/createLink.js
@@ -56,7 +56,7 @@
hasElementChild = !!anchor.querySelector("*");
isEmpty = textContent === "" || textContent === wysihtml5.INVISIBLE_SPACE;
if (!hasElementChild && isEmpty) {
- dom.setTextContent(anchor, anchor.href);
+ dom.setTextContent(anchor, attributes.text || anchor.href);
whiteSpace = doc.createTextNode(" ");
wysihtml5.selection.setAfter(anchor);
wysihtml5.selection.insertNode(whiteSpace);

0 comments on commit 9fe6182

Please sign in to comment.