Silvio Siefke
2014-03-01 17:36:37 UTC
Hello,
i use static website generator and so i clean with tidy the page. But
tidy make some mistakes and i think with sed is the way easy to fix it.
The empty lines i delete with sed -i '/^$/d' index.html, the div i delete
with sed -i 's|<[/]\?div[^>]*>||g' index.html. But i found not a way i can
break line and insert 4 steps of whitespace.
Before:
<title>Silvio Siefke | Blog</title><!--[if lt IE 9]>
<script src="/static/js/html5.js" type="text/javascript"></script>
<![endif]-->
<link href="/static/css/style.css" rel="stylesheet" type="text/css">
After:
<title>Silvio Siefke | Blog</title>
<!--[if lt IE 9]>
<script src="/static/js/html5.js" type="text/javascript"></script>
<![endif]-->
<link href="/static/css/style.css" rel="stylesheet" type="text/css">
How can i relize?
Can i combined all step, delete empty line, delete div, id="ext", id="vid"
and this break line?
Thank you for help & Nice Day
Silvio
i use static website generator and so i clean with tidy the page. But
tidy make some mistakes and i think with sed is the way easy to fix it.
The empty lines i delete with sed -i '/^$/d' index.html, the div i delete
with sed -i 's|<[/]\?div[^>]*>||g' index.html. But i found not a way i can
break line and insert 4 steps of whitespace.
Before:
<title>Silvio Siefke | Blog</title><!--[if lt IE 9]>
<script src="/static/js/html5.js" type="text/javascript"></script>
<![endif]-->
<link href="/static/css/style.css" rel="stylesheet" type="text/css">
After:
<title>Silvio Siefke | Blog</title>
<!--[if lt IE 9]>
<script src="/static/js/html5.js" type="text/javascript"></script>
<![endif]-->
<link href="/static/css/style.css" rel="stylesheet" type="text/css">
How can i relize?
Can i combined all step, delete empty line, delete div, id="ext", id="vid"
and this break line?
Thank you for help & Nice Day
Silvio