开发者

how to append link to text block using Safari Extensions

I'm trying to create a safari extension that will place an "Add to BibDesk" link after any text that looks like a BibText entry. BibText entries look like this:

@string{
    foo  = "bar",
    foo2 = "bar2"
} 

I know how to const开发者_运维百科ruct the necessary regex, but my question is what's the best way, using javascript, to search all the text on a page for a particular bit of text?


Get any elements that can contain text nodes (div, p, etc.) using a selector, then for each element search for any BibText entries and replace the matched text with itself PLUS the link that does the work appended to the end.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜