Action Directory / Find Footnote(查找脚注)

Install

Given a selected footnote label, this action finds its corresponding text somewhere in the document.

Shared by

Script

var str = editor.getText();
var word = editor.getSelectedText();
pattern = '(\\[\\^' + word + '\\]:)\\s(.+)';
var re = new RegExp(pattern);

var match = re.exec(str);

ui.alert(match[2], 'Footnote');