【文件属性】:
文件名称:range-lookup:查找给定文本字符串的匹配 DOM 范围
文件大小:6KB
文件格式:ZIP
更新时间:2021-06-01 09:48:53
JavaScript
范围查找
查找给定文本字符串的所有匹配 DOM。
例子
var rangeLookup = require ( 'range-lookup' ) ;
var ranges = rangeLookup ( 'some string' ) ;
ranges
//=> Array [ Range, Range, Range, Range ]
// Highlight ranges.
var selection = window . getSelection ( ) ;
ranges . forEach ( selection . addRange . bind ( selection ) ) ;
应用程序接口
rangeLookup(query, [opts])
query — 要搜索的字符串。
返回匹配数组。
opts.ignoreCase
在尝试匹配字符串时是否忽略大小写。 默认为
【文件预览】:
range-lookup-master
----.travis.yml(58B)
----example()
--------index.js(379B)
--------index.html(1KB)
--------bundle.js(3KB)
----index.js(1KB)
----package.json(796B)
----LICENSE(1KB)
----.gitignore(15B)
----README.md(1KB)