HTML空白规则的定义? [英] Definition of HTML whitespace rules?

查看:118
本文介绍了HTML空白规则的定义?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找这个定义来使我的HTML渲染器更好一点。目前,它正在猜测哪些空白要保留,哪些要崩溃以及要抛出什么。 SGML标准很难找到,并且HTML标准似乎没有按照我的需求对待具有所需深度的主题。

I'm looking for this definition to make my HTML renderer conform a bit better. Currently it's guessing which whitespace to keep, which to collapse and what to throw. The SGML standard is hard to find and the HTML standard doesn't seem to treat the subject with the required depth for my needs.

目前,我的渲染器将HTML解析为然后执行递归布局来定位所有元素及其内容。我正在尝试在解析阶段抛出一些空白,即在某些情况下不会发出只有空白的文本块。对于大多数情况来说,这种方法有效,但是有一些边缘案例很难处理。

Currently my renderer parses the HTML into a tree and then does a recursive layout pass to position all the elements and their content. I'm experimenting with throwing some whitespace out in the parse stage, i.e. not emitting whitespace only text chunks in certain circumstances. Which kinda works for the majority of cases, but there are a fair few edge cases that are getting hard to deal with.

(我也在编辑一个子类的HTML控件,并且布局时间解决方案在编辑器中被证明是有点问题,因此我正在努力让它们进入解析阶段。布局信息直到重排时间才可用,这是编辑后的一段时间)

(I'm also working on an editor subclass of the HTML control, and layout time solutions are proving to be a bit problem in the editor, hence me working on getting them into the parse stage. The layout information isn't available till reflow time, which is some time after you have edited the document.)

消除联动/火焰。

Fire away with linkage/flames.

推荐答案

我认为 9.1 HTML 4规范中的空白处 a>就是你要找的东西。

I think the section 9.1 White space in the HTML 4 specification is what you’re looking for.

这篇关于HTML空白规则的定义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆