2015-09-16 17:59:03 +00:00
|
|
|
/*\
|
|
|
|
title: $:/plugins/tiddlywiki/text-slicer/modules/slicers/anchor.js
|
|
|
|
type: application/javascript
|
|
|
|
module-type: slicer
|
|
|
|
|
|
|
|
Handle slicing anchor nodes
|
|
|
|
|
|
|
|
\*/
|
|
|
|
(function(){
|
|
|
|
|
|
|
|
/*jslint node: true, browser: true */
|
|
|
|
/*global $tw: false */
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
exports.processAnchorNode = function(domNode,tagName) {
|
2015-09-17 07:41:21 +00:00
|
|
|
if(domNode.nodeType === 1 && tagName === "a") {
|
2015-09-16 17:59:03 +00:00
|
|
|
var id = domNode.getAttribute("id");
|
|
|
|
if(id) {
|
|
|
|
this.registerAnchor(id);
|
2015-09-17 07:41:21 +00:00
|
|
|
return true;
|
2015-09-16 17:59:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
};
|
|
|
|
|
|
|
|
})();
|