Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: option to replace inline styles with classes + <style> tag styles #638

Closed
bpj opened this issue Oct 28, 2017 · 4 comments
Closed

Comments

@bpj
Copy link

bpj commented Oct 28, 2017

I really miss an option to replace inline styles with classes + <style> tag styles

@geoffmcl
Copy link
Contributor

geoffmcl commented Nov 2, 2017

@bpj have you tried the -c, -clean, or --clean yes option? These are all the same...

This will convert -

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>head</title>
</head>
<body>
<p>I am normal</p>
<p style="color:red;">I am red</p>
<p style="color:blue;">I am blue</p>
<p style="font-size:36px;">I am big</p>
</body>
</html>

to

<!DOCTYPE html>
<html>
<head>
<meta name="generator" content=
"HTML Tidy for HTML5 for Windows version 5.5.76">
<meta charset="utf-8">
<title>head</title>

<style type="text/css">
 p.c3 {font-size:36px;}
 p.c2 {color:blue;}
 p.c1 {color:red;}
</style>
</head>
<body>
<p>I am normal</p>
<p class="c1">I am red</p>
<p class="c2">I am blue</p>
<p class="c3">I am big</p>
</body>
</html>

If that is not what you meant, or have some other question, then you will need to explain more...

Including tidy version, giving some sample input code, what config used, what current output, and what you expect as output... thanks...

@geoffmcl geoffmcl added this to the 5.5 milestone Nov 2, 2017
@geoffmcl
Copy link
Contributor

geoffmcl commented Nov 7, 2017

@bpj as asked, does the above answer your question... can this be closed? Thanks...

@geoffmcl
Copy link
Contributor

No response, so assume can close this...

@bpj
Copy link
Author

bpj commented Dec 13, 2017

Sorry for not getting back. Much happening IRL!

It seems --clean is adequate, but its documentation doesn't mention style tags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants