Update code.js
fixed code, changed the way the bookmarklet works (it now replaces the text in the share textbox)
This commit is contained in:
parent
4d402ad761
commit
d62f3b5935
4
code.js
4
code.js
@ -4,6 +4,6 @@ javascript: (function() {
|
||||
string = string.replace(/</g, '<').replace(/>/g, '>').replace(/&/g, '&').replace(/<p> <\/p>/g, '').replace(/'/g, "'");
|
||||
string = string.replace(/(<br \/>(?=Chapters|Summary)|<\/p><p>)/g, '\n\n').replace(/<\/?(i|em)>/g, '*').replace(/<\/?u>/g, '__').replace(/<hr \/>/g, '\n\n---\n').replace(/<a href="(https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&\/\/=\*]*))"( rel="nofollow")>([^<]*)<\/a>/g, '[$5](<$1>)').replace(/<\/?(strong|b)>/g, '**').replace(/<\/?p>/g, '').replace(/<br \/>/g, ' \n');
|
||||
string = string.replace(/<a href="(https?:\/\/\w*\.org\/\w*\/\w*)">(\*\*)?([^<]*)\2<\/a>/g, '$2[$3](<$1>)$2').replace(/<a href="https?:\/\/\w*\.org\/tags\/[A-Za-z%0-9\(\)\*-]*">([^<]*)<\/a>/g, '$1').replace(/\((\d* words)\) (.*\n\n)(Chapters.*\n)(Fandom:.*\nRating.*\n)/g, '$2$4$3Word Count: $1 \n');
|
||||
newString = string.replace(/^(Fandom|Rating|Chapters|Word Count|Warnings|Relationships|Characters|Additional Tags|Summary|Series):/gm, '**$1**\:');
|
||||
alert(newString)
|
||||
var newString = string.replace(/^(Fandom|Rating|Chapters|Word Count|Warnings|Relationships|Characters|Additional Tags|Summary|Series):/gm, '**$1**\:');
|
||||
stringGet.innerHTML = newString
|
||||
})()
|
Loading…
x
Reference in New Issue
Block a user