From 5600a00cd80257208f5165c1f6b12f97bd3e1302 Mon Sep 17 00:00:00 2001 From: lin onetwo Date: Mon, 17 Jun 2024 17:51:50 +0800 Subject: [PATCH] refactor: move links ast extractor to a file --- core/modules/wiki-extract.js | 60 ++++++++++++++++++++++++++++++++++++ core/modules/wiki.js | 60 ------------------------------------ 2 files changed, 60 insertions(+), 60 deletions(-) diff --git a/core/modules/wiki-extract.js b/core/modules/wiki-extract.js index 9f4aad588..6b77ae7b9 100644 --- a/core/modules/wiki-extract.js +++ b/core/modules/wiki-extract.js @@ -12,6 +12,66 @@ AST information extractor for indexers. /*global $tw: false */ "use strict"; +/* +Return an array of tiddler titles that are directly linked within the given parse tree + */ +exports.extractLinks = function(parseTreeRoot) { + // Count up the links + var links = [], + checkParseTree = function(parseTree) { + for(var t=0; t