0

这是当前状态:

HTML FILE:
<!--#set var="header-title" value="Help - Frequently Asked Questions - FAQ" -->
<!--#set var="header-description" value="Answers to common questions about ..." -->
<!--#include virtual="includes/header-basic.htm" -->

INCLUDE FILE:
<!--#if expr="" -->
  Variables:
    header-title
    header-description
<!--#endif -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" />
<head>
...

RENDERED HTML:



<!DOCTYPE... (output starts here after several blank lines)

但我想从呈现的 HTML 中挤出空白。这可能吗?另外,我使用 hexdump 来确认我的文件中没有 UTF8 BOM。

4

1 回答 1

1

感谢 (Ivan Shmakov) comp.infosystems.www.servers.unix。一种方法是:

<!--#set var="header-title" value="Help - Frequently Asked Questions - FAQ" 
--><!--#set var="header-description" value="Answers to common questions about ..." 
--><!--#include virtual="includes/header-basic.htm" --> 

此外,另一种选择(未记录的 Apache 行为?)是组合 set 指令:

<!--#set 
  var="header-title" value="Help - Frequently Asked Questions - FAQ"
  var="header-description" value="Answers to common questions about..."
--><!--#include virtual="includes/header-basic.htm" -->
于 2013-02-22T19:08:00.973 回答