astralaaron Posted December 23, 2013 Share Posted December 23, 2013 I have a ton of old pages written out with stuff like this: <font size="4"><b><u><font color="red">Chapter One</font></u></b></font><font size="3"><font color="black">Once upon a <b>time</b>....</font></font> would it be possible to convert these to span tags with inline style? even just the font tags.. for example: <span style="font-size:16px;font-weight:bold;color:red;text-decoration:underline;">Chapter One</style>or even<b><u><span style="font-size:16px;color:red;">Chapter One</style></b></u> Link to comment Share on other sites More sharing options...
Wolverine Posted December 23, 2013 Share Posted December 23, 2013 How about use <h1 style="color"red;">Chapter one</h1> <h3 style="color"black;">Once upon a time</h3> for your headings. Otherwise I don't see any problems with your for example styles. Link to comment Share on other sites More sharing options...
astralaaron Posted December 23, 2013 Author Share Posted December 23, 2013 this seems to work perfect in FireFox, but then doesn't work in internet explorer.... is there a way to make it happen? document.execCommand("insertHTML", false, "<span class='own-class'>"+ document.getSelection()+"</span>"); Link to comment Share on other sites More sharing options...
davej Posted December 23, 2013 Share Posted December 23, 2013 (edited) I have a ton of old pages written out with stuff like this: <span style="font-size:16px;font-weight:bold;color:red;text-decoration:underline;">Chapter One</style> So you're gonna write a cool C# program to extract all the unique styles? I guess once you extract all the styles you could then sort them and factor them into the minimum number of classes, but as you demonstrate, you'd also need to compress common tags such as <b> and <strong> into styles. Edited December 23, 2013 by davej Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now