热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

帮助查找未关闭标签的HTML编辑器-HTMLeditorsthathelpfindunclosedtags

IvebeeneditingalotofHTMLpageswithbasictexteditor,notepad.WhenIwenttovalidatethem

I've been editing a lot of HTML pages with basic text editor, notepad. When I went to validate them the validation service is saying theres a div tag that is not closed. I tend to find automatic error reports such as these dont tend to be too reliable, i.e they will give you a line number and the error but often times the error is actually in another part of the file entirely.

我用基本的文本编辑器,记事本编辑了很多HTML页面。当我去验证它们时,验证服务说有一个没有关闭的div标签。我倾向于发现诸如此类的自动错误报告往往不太可靠。他们会给你一个行号和错误,但通常情况下错误实际上是整个文件的另一部分。

I'm just wondering if there are any free lightweight html editors that have the functionality of finding the closing tag for a tag. For example, you click on a tag then click a shortcut, and the program will jump to the closing tag, I know this functionality is in homesite, but i dont have homesite, and its a bit of a bulky program anyway.

我想知道是否有任何免费的轻量级html编辑器具有查找标记结束标记的功能。例如,你点击一个标签然后点击一个快捷键,程序就会跳转到结束标签,我知道这个功能在homesite中,但是我没有homesite,而且这个程序有点大。

Or even better any online html validation services that can highlight unclosed tags?

或者更好的是任何可以突出显示未关闭标记的在线html验证服务?

To sum up, I would like to know how to find html tags that don't have closing tags - is there a free html editor or simple online service that can help with this?

总之,我想知道如何找到没有结束标记的html标记——有免费的html编辑器或简单的在线服务可以帮助这一点吗?

8 个解决方案

#1


41  

If you save your HTML as page.xhtml (instead of page.html), the browser (Firefox/Chrome or Opera) should find the un-closed tags for you without the need for a validator. Just remember to rename them .html before serving them online - IE doesn't support .xhtml files yet.

如果将HTML保存为页面。xhtml(而不是page.html),浏览器(Firefox/Chrome或Opera)应该为您找到未关闭的标记,而不需要验证器。只要记住在在线服务之前重命名它们。html——IE还不支持。xhtml文件。

Edit (3 years later): This post's still getting comments/upvotes so a slight amendment. IE9 and IE10 do now support xhtml files.

编辑(3年后):这篇文章仍然得到评论/支持,所以只是一个小小的修改。IE9和IE10现在都支持xhtml文件。

#2


9  

Use the firefox view source - wrong code will be in different color

使用firefox查看源代码——错误的代码将会以不同的颜色显示

#3


7  

Notepad++ - never had any problems with it and also never had any unclosed html tag with it.

Notepad++ -从来没有任何问题,也从来没有任何未关闭的html标签。

You can just click on any element and see if it has a closing tag. Also you can do this: click on "TextFX"(left from plugins in navigation) -> click on "Text FX HTML Tidy" -> click on lets say hmm "TiDy clean Document - wrap". That should fix your html document, aka close all unclosed elements.

您可以单击任何元素,看看它是否有结束标记。你也可以这样做:点击“TextFX”(在导航栏中留下的插件)->点击“TextFX HTML Tidy”->点击让我们说“整洁干净的文件-包装”。这将修复html文档,即关闭所有未关闭的元素。

#4


4  

http://validator.w3.org/

http://validator.w3.org/

Does more than just unclosed tags. Should be used by all front-end developers, IMO.

不仅仅是未关闭的标签。应该被所有前端开发人员使用,IMO。

#5


1  

I am using two online-tool, which work very fine. jona.ca and tormus.com

我正在使用两个在线工具,效果很好。约娜说道。ca和tormus.com

#6


1  

CSE HTML Validator Lite is a free lightweight editor (for Windows) that will check your HTML (just press F6) and find missing end tags and other problems. You can also press Ctrl+M on a start tag or end tag and it will take you to the matching start or end tag.

CSE HTML Validator Lite是一个免费的轻量级编辑器(用于Windows),它可以检查HTML(只需按F6),并找到丢失的结束标记和其他问题。您还可以在开始标记或结束标记上按Ctrl+M,它将带您到匹配的开始标记或结束标记。

A simple online service that will also do this (and more) is OnlineWebCheck.com. There are other online services but in my opinion the one I just mentioned is the simplest one to use and understand.

一个简单的在线服务也会这样做(更多)是OnlineWebCheck.com。还有其他的在线服务,但是在我看来,我刚才提到的这个是最简单的一个。

Full disclosure: I am the developer of CSE HTML Validator Lite and http://www.OnlineWebCheck.com/ which is based on CSE HTML Validator.

完全披露:我是CSE HTML Validator Lite和http://www.OnlineWebCheck.com/的开发人员,它基于CSE HTML验证器。

#7


0  

free lightweight html editors ... online html validation services that can highlight unclosed tags?

免费的轻量级html编辑器…在线html验证服务可以高亮显示未关闭的标记?

Use linter-vnu.

使用linter-vnu。

linter-vnu is a package for the Atom editor that uses the Nu Html Checker (v.Nu) to validate HTML or XHTML documents.

lintervnu是一个Atom编辑器的包,它使用Nu Html Checker (vnu)来验证Html或XHTML文档。

Disclosure: I am the developer of linter-vnu.

披露:我是linter-vnu的开发者。

linter-vnu uses another Atom package, linter, to integrate v.Nu and Atom.

linter-vnu使用另一个Atom包linter来集成v。ν和原子。

For example, if you open the following test.html file in Atom:

例如,如果您打开下面的测试。在原子html文件:








Lorem ipsum dolor sit amet...

(with a deliberately missing closing

tag)

(故意丢失关闭标签)

then Atom (or rather, linter-vnu, thanks to linter and v.Nu) displays the following error messages:

然后Atom(或者更确切地说是linter-vnu,多亏了linter和v.Nu)显示了以下错误消息:

  • Unclosed element “div”. at line 8 col 1 in test.html
  • 打开元素" div "。在test.html中的第8行
  • End tag for “body” seen, but there were unclosed elements. at line 10 col 1 in test.html
  • 看到“body”的结束标记,但是有未关闭的元素。在test.html中的第10行

and marks those lines in the editor with red dots.

在编辑器中用红点标记这些线。

If you click the "at..." (hyperlinked text) in the error message, the editor insertion point moves to the corresponding line, and a popup appears under the line, with the error text ('Unclosed element "div".').

如果你点击“at…”(超链接文本)在错误消息中,编辑器插入点移动到相应的行,并在一行中出现一个弹出框,其中有错误文本(“Unclosed element”div“。”)。

If you save your HTML document with the file extension .xhtml, and open it in Atom, then v.Nu validates your document as XHTML (XML) rather than HTML, with slightly different messages. In this case, just one error message:

如果您使用文件扩展名.xhtml保存HTML文档,并在Atom中打开它,那么v。Nu将文档验证为XHTML (XML)而不是HTML,使用稍微不同的消息。在这种情况下,只有一条错误消息:

  • required character (found “b”) (expected “d”) at line 10 col 3
  • 要求的字符(找到“b”)(预期的“d”)在第3行

where line 10 contains the closing tag. v.Nu was expecting a

tag instead; it was happy with - it was expecting a closing tag - but it was expecting the element name to begin with "d" for "div", not "b" for "body".

其中第10行包含关闭的标记。v。Nu希望得到一个标签;它对

I make the following claims, as of November 2016:

从2016年11月开始,我提出以下主张:

  • v.Nu is the best option for validating (X)HTML(5).
  • v。Nu是验证(X)HTML(5)的最佳选择。
  • linter-vnu is the best option for interactively harnessing v.Nu in an editor. linter-vnu itself is trivial; it's just a few lines of "glue" code. What makes it the best option is the Atom editor and the Atom linter package.
  • linter-vnu是交互式利用v的最佳选择。ν在一个编辑器。linter-vnu本身是微不足道的;这只是几行“胶水”代码。使它成为最佳选项的是Atom编辑器和Atom linter包。

I welcome counterclaims and questions about these claims. I'd be happy to be proven wrong and be shown something better. Especially if, like v.Nu and linter-vnu, it's free.

我欢迎关于这些索赔的反诉和问题。我很高兴被证明是错误的,并且表现得更好。特别是,像v。Nu和lintervnu,它是免费的。

#8


0  

If your code is very messy, not prettified nor indented, v.Nu (as seen at https://validator.w3.org/nu/) will often get confused (for instance if there's an extre closing tag, it may not manage to select the one which is really wrong).

如果你的代码很乱,不漂亮也不缩进,v。Nu(如https://validator.w3.org/nu/所示)经常会混淆(例如,如果有一个extre关闭标记,它可能无法选择一个真正错误的标记)。

One solution is code folding: by collapsing all the code which is marked as a child of a certain node, you can often easily spot some incorrect hierarchy.

一种解决方案是代码折叠:通过折叠所有标记为某个节点的子节点的代码,您通常可以很容易地发现一些不正确的层次结构。

An example of editor which supports code folding is Kate editor: see the arrows on the left in their screenshot. Kate screenshot

支持代码折叠的编辑器示例是Kate editor:请参阅屏幕截图中左边的箭头。


推荐阅读
  • 如何自行分析定位SAP BSP错误
    The“BSPtag”Imentionedintheblogtitlemeansforexamplethetagchtmlb:configCelleratorbelowwhichi ... [详细]
  • 基于PgpoolII的PostgreSQL集群安装与配置教程
    本文介绍了基于PgpoolII的PostgreSQL集群的安装与配置教程。Pgpool-II是一个位于PostgreSQL服务器和PostgreSQL数据库客户端之间的中间件,提供了连接池、复制、负载均衡、缓存、看门狗、限制链接等功能,可以用于搭建高可用的PostgreSQL集群。文章详细介绍了通过yum安装Pgpool-II的步骤,并提供了相关的官方参考地址。 ... [详细]
  • Nginx使用(server参数配置)
    本文介绍了Nginx的使用,重点讲解了server参数配置,包括端口号、主机名、根目录等内容。同时,还介绍了Nginx的反向代理功能。 ... [详细]
  • 基于layUI的图片上传前预览功能的2种实现方式
    本文介绍了基于layUI的图片上传前预览功能的两种实现方式:一种是使用blob+FileReader,另一种是使用layUI自带的参数。通过选择文件后点击文件名,在页面中间弹窗内预览图片。其中,layUI自带的参数实现了图片预览功能。该功能依赖于layUI的上传模块,并使用了blob和FileReader来读取本地文件并获取图像的base64编码。点击文件名时会执行See()函数。摘要长度为169字。 ... [详细]
  • HDU 2372 El Dorado(DP)的最长上升子序列长度求解方法
    本文介绍了解决HDU 2372 El Dorado问题的一种动态规划方法,通过循环k的方式求解最长上升子序列的长度。具体实现过程包括初始化dp数组、读取数列、计算最长上升子序列长度等步骤。 ... [详细]
  • Firefox火狐浏览器关闭到http://detectportal.firefox.com的流量问题解决办法
    本文介绍了使用Firefox火狐浏览器时出现关闭到http://detectportal.firefox.com的流量问题,并提供了解决办法。问题的本质是因为火狐默认开启了Captive portal技术,当连接需要认证的WiFi时,火狐会跳出认证界面。通过修改about:config中的network.captive-portal-service.en的值为false,可以解决该问题。 ... [详细]
  • ZSI.generate.Wsdl2PythonError: unsupported local simpleType restriction ... [详细]
  • http:my.oschina.netleejun2005blog136820刚看到群里又有同学在说HTTP协议下的Get请求参数长度是有大小限制的,最大不能超过XX ... [详细]
  • 本文介绍了通过ABAP开发往外网发邮件的需求,并提供了配置和代码整理的资料。其中包括了配置SAP邮件服务器的步骤和ABAP写发送邮件代码的过程。通过RZ10配置参数和icm/server_port_1的设定,可以实现向Sap User和外部邮件发送邮件的功能。希望对需要的开发人员有帮助。摘要长度:184字。 ... [详细]
  • 自动轮播,反转播放的ViewPagerAdapter的使用方法和效果展示
    本文介绍了如何使用自动轮播、反转播放的ViewPagerAdapter,并展示了其效果。该ViewPagerAdapter支持无限循环、触摸暂停、切换缩放等功能。同时提供了使用GIF.gif的示例和github地址。通过LoopFragmentPagerAdapter类的getActualCount、getActualItem和getActualPagerTitle方法可以实现自定义的循环效果和标题展示。 ... [详细]
  • 本文介绍了使用PHP实现断点续传乱序合并文件的方法和源码。由于网络原因,文件需要分割成多个部分发送,因此无法按顺序接收。文章中提供了merge2.php的源码,通过使用shuffle函数打乱文件读取顺序,实现了乱序合并文件的功能。同时,还介绍了filesize、glob、unlink、fopen等相关函数的使用。阅读本文可以了解如何使用PHP实现断点续传乱序合并文件的具体步骤。 ... [详细]
  • 本文讨论了在Spring 3.1中,数据源未能自动连接到@Configuration类的错误原因,并提供了解决方法。作者发现了错误的原因,并在代码中手动定义了PersistenceAnnotationBeanPostProcessor。作者删除了该定义后,问题得到解决。此外,作者还指出了默认的PersistenceAnnotationBeanPostProcessor的注册方式,并提供了自定义该bean定义的方法。 ... [详细]
  • Voicewo在线语音识别转换jQuery插件的特点和示例
    本文介绍了一款名为Voicewo的在线语音识别转换jQuery插件,该插件具有快速、架构、风格、扩展和兼容等特点,适合在互联网应用中使用。同时还提供了一个快速示例供开发人员参考。 ... [详细]
  • 本文介绍了计算机网络的定义和通信流程,包括客户端编译文件、二进制转换、三层路由设备等。同时,还介绍了计算机网络中常用的关键词,如MAC地址和IP地址。 ... [详细]
  • 拥抱Android Design Support Library新变化(导航视图、悬浮ActionBar)
    转载请注明明桑AndroidAndroid5.0Loollipop作为Android最重要的版本之一,为我们带来了全新的界面风格和设计语言。看起来很受欢迎࿰ ... [详细]
author-avatar
世界和平啊
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有