5
File.htmlHTML整潔的開始剝離空間
word<i><span> <span>ratti</span></span></i>
命令
輸出
word<i>ratti</i>
所需的輸出
word<i> ratti</i>
空間在哪裏?
登錄
line 1 column 1 - Warning: missing <!DOCTYPE> declaration line 1 column 1 - Warning: plain text isn't allowed in <head> elements line 1 column 8 - Warning: <span> is probably intended as </span> line 1 column 5 - Warning: replacing unexpected span by </span> line 1 column 33 - Warning: discarding unexpected </span> line 1 column 40 - Warning: discarding unexpected </i> line 1 column 1 - Warning: inserting missing 'title' element line 1 column 8 - Warning: trimming empty <span> Info: Document content looks like HTML 4.01 Transitional 8 warnings, 0 errors were found! <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta name="generator" content= "HTML Tidy for Linux/x86 (vers 1st November 2003), see www.w3.org"> <title></title> </head> <body> word<i>ratti</i> </body> </html>
似乎被整齊丟棄,你試過牢不可破的空間 ? –
我無法對HTML做任何事情,它只是10K +行文件的樣本,並且有成千上萬個這樣的文件,我無法編輯它們的HTML。在這種情況下,'tidy'應該有一個選項來保存空格。順便說一句來回答你的問題,是的,它工作正常 –
你可以嘗試這個選項--add-xml-space是 –