您正在将该函数应用于整个标题innerHTML,其中包括锚的href属性。这应该适用于您的小提琴示例:
$('h1 a, h2 a, h3 a, h4 a').ligature( //...
但是,它仅适用于标题内的链接,我不确定这是否是您要查找的内容。如果您想要适用于某个元素内的任何内容(具有任何级别的标签嵌套)的东西,那么您将需要一种递归方法。这是一个想法,它基本上是纯 JavaScript,因为 jQuery 不提供针对 DOM 文本节点的方法:
$.fn.ligature = function(str, lig) {
    return this.each(function() {
        recursiveLigatures(this, lig);
    });
    function recursiveLigatures(el, lig) {
        if(el.childNodes.length) {
            for(var i=0, len=el.childNodes.length; i<len; i++) {
                if(el.childNodes[i].childNodes.length > 0) {
                    recursiveLigatures(el.childNodes[i], lig);
                } else {
                    el.childNodes[i].nodeValue = htmlDecode(el.childNodes[i].nodeValue.replace(new RegExp(str, 'g'), lig));
                }
            }
        } else {
            el.nodeValue = htmlDecode(el.nodeValue.replace(new RegExp(str, 'g'), lig));
        }
    }
    // http://stackoverflow.com/a/1912522/825789
    function htmlDecode(input){
      var e = document.createElement('div');
      e.innerHTML = input;
      return e.childNodes.length === 0 ? "" : e.childNodes[0].nodeValue;
    }
};
// call this from the document.ready handler
$(function(){
    $('h3').ligature('ffi', 'ffi')
           .ligature('ffl', 'ffl')
           .ligature('ff', 'ff')
           .ligature('fi', 'fi')
           .ligature('fl', 'fl');
});
这应该适用于这样的内容:
<h3>
    mixed ffi content 
    <span>this is another tag ffi <span>(and this is nested ffi</span></span>
    <a href="/news/here-is-a-url-with-ffi-ligature">Here is a ffi ligature</a>
</h3>
http://jsfiddle.net/JjLZR/