gpt4 book ai didi

html - Hakyll 生成奇怪的 HTML - 谁能解释原因?

转载 作者:太空狗 更新时间:2023-10-29 15:58:18 26 4
gpt4 key购买 nike

我使用 Hakyll 生成一些文档,我注意到它有一种奇怪的方式来关闭它生成的代码中的 HTML 标签。

有一个页面他们说你必须像他们那样生成标记,否则你的页面布局在某些情况下会被破坏,但我现在找不到了。

我创建了一个小的测试页面(下面的代码),其中有一个带有“正常”HTML 标记的红色层,以及一个带有类似于 hakyll 生成的标记的黄色层。

我在 Firefox 中看不出这两个 div 有什么不同。

谁能解释一下他们说的是否属实?

<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>

最佳答案

实际上是pandoc那就是生成 HTML 代码。 Pandoc 问题跟踪器中有一个很好的解释:

http://code.google.com/p/pandoc/issues/detail?id=134

The reason is because any whitespace (including newline and tabs) between HTML tags will cause the browser to insert a space character between those elements. It is far easier on the machine logic to leave these spaces out, because then you don't need to think about the possible ways that the HTML text formatting could be messing with the browser adding extra spaces.

关于html - Hakyll 生成奇怪的 HTML - 谁能解释原因?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3893038/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com