是否有HTML整齐的方法吗? [英] Is there an alternative to HTML Tidy?

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

问题描述

我在我的应用程序清理传入HTML嵌入HTML整洁。但整洁有一个巨大的错误量,直接在源修复它们是我最糟糕的噩梦。整齐源$ C ​​$ c是的不可读憎恶的。千+线功能,可怜的变量命名,意粉code等,这是真正可怕的。

I have embedded HTML Tidy in my application to clean incoming HTML. But Tidy has a huge amount of bugs and fixing them directly in the source is my worst nightmare. Tidy source code is an unreadable abomination. Thousand+ line functions, poor variable naming, spaghetti code etc. It's truly horrible.

更糟糕的是,官方发展<一href=\"http://sourceforge.net/project/stats/detail.php?group_id=27659&ugn=tidy&mode=12months&type=cvs\">seems已经停止。在过去12个月中,已有的的写事务官CVS回购。但它已经死了,埋比这更长的时间......

Worse yet, official development seems to have ceased. In the last 12 months, there have been three write transactions to the official CVS repo. But it's been dead and buried for much longer than that...

所以我在寻找一个OSS C或C ++应用程序/库,可以做什么整洁能(当它感觉就像是):解决不良HTML标记并将其转换成有效的XHTML(这是我感兴趣的一部分在)。我的意思是各种不良的标记。

So I'm looking for an OSS C or C++ application/library that can do what Tidy can (when it feels like it): fix bad HTML markup and transform it into valid XHTML (this is the part I'm interested in). And I mean all sorts of bad markup.

有没有类似的东西在那里?

Is there something like that out there?

编辑:我需要它无论是通过XML处理工具,对DOM树操作和使用XHTML规范一般合规性。我的应用程序需要接受来自用户的HTML(这是在各种方式往往无效),输出有效的XHTML。它需要能够处理甚至HTML浏览器中,因为该用户手工编辑它并没有事后检查通常不显示。

I need it both for manipulations on the DOM tree by an XML handling tool and for general compliance with the XHTML spec. My app needs to accept HTML from users (which is often invalid in all sorts of ways) and output valid XHTML. It needs to be able to handle even HTML that would normally not display in a browser because the user edited it by hand and didn't check afterwards.

一个下拉更换为整洁的纠错分析器...这不吸。我不介意的错误如果源是可读的,我可以解决自己的问题,或者是否有一个谁及时地提供错误修正​​活跃的开发者。

A drop-in replacement for Tidy's error-correcting parser... that doesn't suck. I don't mind bugs if the source is readable and I can fix problems myself, or if there are active developers who provide bugfixes on a timely basis.

推荐答案

有一个新的,漂亮的,适当的HTML 5支持整齐,所以替代旧的,丑陋的整理整洁(的 GitHub的库)。

There is a new, nice, proper HTML 5 supporting Tidy, so the alternative to old, ugly Tidy would be Tidy (GitHub repository).

这篇关于是否有HTML整齐的方法吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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