Meh*_*Meh 5 html markup template-engine hakyll
我使用Hakyll生成一些文档,我注意到它有一种奇怪的方式来关闭它生成的代码中的HTML标记.
有一个页面,他们说你必须像他们一样生成标记,否则你的页面布局会在某些条件下被破坏,但我现在找不到它.
我创建了一个小测试页面(下面的代码),它有一个带有"普通"HTML标记的红色图层,以及一个带有类似于hakyll生成的标记的黄色图层.
我看不出两个div之间的Firefox有什么不同.
任何人都可以解释他们说的是真的吗?
<html>
<body>
<!-- NORMAL STYLE -->
<div style="background: red">
<p>Make available the code from the library you added to your application. Again, the way to do this varies between languages (from adding import statements in python to adding a jar to the classpath for java)</p>
<p>Create an instance of the client and, in your code, make calls to it through this instance's methods.</p>
</div>
<!-- HAKYLL STYLE -->
<div style="background: yellow"
><p
>Make available the code from the library you added to your application. Again, the way to do this varies between languages (from adding import statements in python to adding a jar to the classpath for java)</p
><p
>Create an instance of the client and, in your code, make calls to it through this instance's methods.</p
></div
>
</body>
<html>
Run Code Online (Sandbox Code Playgroud)
它实际上是生成HTML代码的pandoc.Pandoc问题跟踪器中有一个很好的解释:
http://code.google.com/p/pandoc/issues/detail?id=134
原因是HTML标记之间的任何空格(包括换行符和制表符)都会导致浏览器在这些元素之间插入空格字符.在机器逻辑上放置这些空间要容易得多,因为那时你不需要考虑HTML文本格式化可能会弄乱浏览器添加额外空间的可能方式.