Finding Italicized Words in Websites
-
- Posts: 5
- Joined: October 9th, 2012, 10:50 pm
Finding Italicized Words in Websites
I'm not sure if this is the right section to ask but anyway is there perhaps an add-on that can find Italicized words or something similar? I'm making an epub of a translated novel and finding those Italicized words manually is pretty tiresome.
- LIMPET235
- Moderator
- Posts: 39939
- Joined: October 19th, 2007, 1:53 am
- Location: The South Coast of N.S.W. Oz.
Re: Finding Italicized Words in Websites
Moving to Firefox Support...
Have you tried searching the Addons site?
> https://addons.mozilla.org/en-US/firefo ... &cat=1%2C0
Take note of any comments by the author/s, as they may stop support for it/them soon.
Have you tried searching the Addons site?
> https://addons.mozilla.org/en-US/firefo ... &cat=1%2C0
Take note of any comments by the author/s, as they may stop support for it/them soon.
[Ancient Amateur Astronomer.]
Win-10-H/64 bit/500G SSD/16 Gig Ram/450Watt PSU/350WattUPS/Firefox-115.0.2/T-bird-115.3.2./SnagIt-v10.0.1/MWP-7.12.125.
(Always choose the "Custom" Install.)
Win-10-H/64 bit/500G SSD/16 Gig Ram/450Watt PSU/350WattUPS/Firefox-115.0.2/T-bird-115.3.2./SnagIt-v10.0.1/MWP-7.12.125.
(Always choose the "Custom" Install.)
- dickvl
- Posts: 54146
- Joined: July 18th, 2005, 3:25 am
Re: Finding Italicized Words in Websites
Maybe use the Web Console or a bookmarklet if you are only interested in Italicized words and not its context.
It shouldn't be too difficult to come up with some JavaScript to find such text.
You can add a class to found nodes and use a style sheet or set a background color.
Some code to play with:
It shouldn't be too difficult to come up with some JavaScript to find such text.
You can add a class to found nodes and use a style sheet or set a background color.
Some code to play with:
Code: Select all
var e=document.querySelectorAll("div,p,span"),E,i,F=[];
for(i=0; E=e[i]; i++){
if(E.style.getPropertyValue("font-style") == "italic"){
E.style.setProperty("background-color","#fcf","important");
E.focus();
C = {"node":E.nodeName,"content":E.textContent};
F.push(C);
prompt(JSON.stringify(C), JSON.stringify(C));
}
}
prompt(JSON.stringify(F), JSON.stringify(F));