Changeset 9697
- Timestamp:
- 04/18/08 19:02:46 (5 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/vimperator-plugins/trunk/direct_bookmark.js
r9693 r9697 138 138 function parseHTML(str, ignore_tags){ 139 139 str = str.replace(/^[\s\S]*?<html(?:\s[^>]+?)?>|<\/html\s*>[\S\s]*$/ig, ''); 140 if (ignore_tags && ignore_tags instanceof Array) 141 str = str.replace(new RegExp('<' + ignore_tags.join('[^>]+?>|<') + '[^>]+?>', 'ig'), ''); 140 if (ignore_tags && ignore_tags instanceof Array) { 141 ignore_tags.forEach(function(t) { 142 str = str.replace(new RegExp('<' + t + '(?:\\s[^>]+?)?>|<\\/' + t + '\\s*>', 'ig'), ''); 143 }); 144 } 142 145 var res = document.implementation.createDocument(null, 'html', null); 143 146 var range = document.createRange(); … … 256 259 xhr.send(null); 257 260 258 var mypage_html = parseHTML(xhr.responseText, ['img' ]);261 var mypage_html = parseHTML(xhr.responseText, ['img', 'script']); 259 262 var tags = getElementsByXPath("//ul[@id=\"taglist\"]/li/a",mypage_html); 260 263
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)