HTML 输入的理想用户反馈
让我们面对现实:编写正确的、符合标准的 HTML 是相当困难的。 编写语义 HTML 更是如此,但我认为计算机不可能弄清楚这一点。
所以我的问题是,对于输入 HTML 的用户来说,“理想”的反馈是什么? 它会是 W3C 验证器样式的错误列表以及相应的行号和列吗? 它会是突出显示的行的带注释的代码显示、错误的解释以及可能的修复吗? 拼写检查风格模式,您可以单独处理每个错误? 是否会不向他们提供任何错误信息? 另外,最好告诉用户哪些类型的错误? (一些广泛的错误类别包括解析错误、嵌套错误(即将 div 放入 ab 标记中)和格式良好错误。)
- Scottm: 好点; 我也不喜欢 W3C 列出所有错误的方式。 然而,仍然存在让用户适当编辑有问题的 HTML 的问题。
- onebyone: 好的,那么查看一些屏幕截图看起来 HTML Validator 有一个 W3C 错误列表,但结合了直接转到相关源代码段和扩展错误信息的能力,以及您不必滚动即可从一个部分跳转到另一个部分的事实。 看起来不错,但是普通人能用吗?
编辑1:澄清一下,这是关于接口的,不一定是底层实现的。 然而,界面需要能够使用纯 HTML 和 JavaScript(如果只需要 HTML,则可用性加倍,但我认为在这种情况下您将陷入 W3C)。
Let's face it: writing proper, standards compliant HTML is quite difficult to do. Writing semantic HTML is even more so, but I don't think it's possible for a computer to figure that out.
So my question to you is what would the "ideal" feedback for a user who entered HTML be? Would it be a W3C validator style list of errors and corresponding line numbers and columns? Would it be a annotated code display of highlighted lines, explanations of the errors, and possible fixes? A spell-check style mode where you handle each error separately? Would it be not giving them any error information at all? Also, what types of errors are a good idea to tell users? (Some broad classes of errors include parsing errors, nesting errors (i.e. putting a div in a b tag) and well-formedness errors.)
- Scottm: Good point; I've never liked the W3C way of listing all the errors either. However, there is still the question of then letting the user edit the offending HTML appropriately.
- onebyone: Ok, so looking at some screenshots it looks like HTML Validator has a W3C error list, but combined with the ability to go straight to the relevant source segment and expanded error information, as well as the fact that you don't have to go scrolly to jump from one section to another. Looks pretty good, but is it usable by the average Joe?
Edit 1: As a clarification, this is with regards to the interface, not necessarily the underlying implementation. However, interface needs to be feasible with plain HTML and JavaScript (double usability points if it just needs HTML, but I think you're going to get stuck with W3C in that case).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Firefox“HTML 验证器”附加组件的输出非常好。 它在一个大窗口中向您显示源代码,并在一个小窗口中显示错误列表(小窗口并不重要,因为您通常只关心第一个,因为您的目标是完全没有错误)。 单击要突出显示的错误,第二个小窗口中会显示扩展的解释,而代码的有问题部分会在大窗口中突出显示。
不过,该附加组件不包含文本编辑器,因此它不能完全解决您的问题。 不过,它同时使用基于 SGML 的验证器和 HTML Tidy,而且我认为对于本地文件,您可以使用它来进行 Tidy 建议的更正。
The output from the Firefox "HTML validator" add-on is pretty good. It shows you the source in a big window, and a list of errors in a small window (smallness doesn't matter, since you generally only care about the first one, since you're aiming for a total of none). Click an error to highlight, and an expanded explanation is shown in a second small window, while the offending part of the code is highlighted in the big window.
The add-on doesn't include a text editor, though, so it's not a full solution to your problem. It uses both an SGML-based validator and HTML Tidy, though, and I think for local files you can get it to make the corrections suggested by Tidy.
我一直认为语法高亮很棒。 在 HTML 中,这也非常有用,因为当开发人员可以看到标签具有适当的颜色时,他/她可以轻松区分标签。
就我个人而言,我不喜欢 W3C 给你列出一大堆无聊问题的方式。 代码本身的视觉辅助要好得多。
I always think syntax highlighting is great. In HTML this would be very useful too, as tags can be easily distinguished by the developer when he/she can see them appropraitely coloured.
Personally I don't like the W3C way of giving you a big boring list of problems. Visual aids in the code itself are much better.