From 6e5a51c43e686072bede10527d6ed9b58b0fd4ab Mon Sep 17 00:00:00 2001 From: "Ryan P. C. McQuen" Date: Thu, 20 Sep 2018 13:18:24 -0700 Subject: [PATCH] v1.0.0, line numbers are now included with unclosed tags. Signed-off-by: Ryan P. C. McQuen --- README.md | 25 ++------------- foo.html | 5 ++- unclosedTagFinder.py | 75 +++++++++++++++++++++++++------------------- 3 files changed, 50 insertions(+), 55 deletions(-) diff --git a/README.md b/README.md index 0424051..2d0c8b2 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,14 @@ # unclosedTagFinder + [![GitHub license](https://img.shields.io/badge/license-GPLv2-blue.svg)](https://raw.githubusercontent.com/ryanpcmcquen/unclosedTagFinder/master/LICENSE) -[![GitHub version](https://img.shields.io/badge/version-0.4.0-orange.svg)](https://github.com/ryanpcmcquen/unclosedTagFinder/releases) +[![GitHub version](https://img.shields.io/badge/version-1.0.0-orange.svg)](https://github.com/ryanpcmcquen/unclosedTagFinder/releases) [![GitHub issues](https://img.shields.io/github/issues/ryanpcmcquen/unclosedTagFinder.svg)](https://github.com/ryanpcmcquen/unclosedTagFinder/issues) [![Twitter](https://img.shields.io/twitter/url/https/github.com/ryanpcmcquen/unclosedTagFinder.svg?style=social)](https://twitter.com/intent/tweet?text=Hey%2C%20check%20this%20out%3A%20https%3A%2F%2Fgithub.com%2Fryanpcmcquen%2FunclosedTagFinder&url=%5Bobject%20Object%5D) Find unclosed tags in HTML source. ### Usage: + ``` $ ./unclosedTagFinder.py -i '' @@ -25,27 +27,6 @@ Your HTML is perfectly matched. You're awesome! --- -### TODO: - -**Important**: - -- [x] Read file input. -- [x] Accomodate tag names with attributes. -- [x] Ignore self closing tags. -- [x] Read remote files. -- [x] Accomodate user input. -- [x] Improve command line interface and output. -- [ ] Give line numbers of unclosed tags. -- [ ] Improve error output. -- [ ] Include unit tests. - -**Maybe**: -- [ ] Add a GUI. -- [ ] Accomodate multiple files. -- [ ] Fix code? - ---- - Thanks to the Wingware Pro IDE for making Python development even more fun! ![Wingware!](https://wingware.com/images/wingware-button-200x89.png) diff --git a/foo.html b/foo.html index 177af1b..700834a 100644 --- a/foo.html +++ b/foo.html @@ -2,6 +2,9 @@

+ Ignore this line. + Foo
- + + \ No newline at end of file diff --git a/unclosedTagFinder.py b/unclosedTagFinder.py index f870787..055069c 100755 --- a/unclosedTagFinder.py +++ b/unclosedTagFinder.py @@ -3,13 +3,14 @@ import argparse import urllib.parse import urllib.request +from collections import OrderedDict -htmlRegex = r'<[^\!][^>]*>' +htmlRegex = r'\s*<[^\!][^>]*>' # Void elements: # https://www.w3.org/TR/html/syntax.html#void-elements -voidElementsRegex = r'