{"id":19041712,"url":"https://github.com/mikeizbicki/html_validator","last_synced_at":"2025-04-16T08:54:32.513Z","repository":{"id":54558531,"uuid":"238632615","full_name":"mikeizbicki/html_validator","owner":"mikeizbicki","description":null,"archived":false,"fork":false,"pushed_at":"2023-02-08T07:53:13.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":126,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T05:22:36.041Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mikeizbicki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-06T07:36:35.000Z","updated_at":"2023-01-30T06:17:12.000Z","dependencies_parsed_at":"2023-02-18T10:45:23.164Z","dependency_job_id":null,"html_url":"https://github.com/mikeizbicki/html_validator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeizbicki%2Fhtml_validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeizbicki%2Fhtml_validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeizbicki%2Fhtml_validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeizbicki%2Fhtml_validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikeizbicki","download_url":"https://codeload.github.com/mikeizbicki/html_validator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249222139,"owners_count":21232437,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T22:31:09.584Z","updated_at":"2025-04-16T08:54:32.497Z","avatar_url":"https://github.com/mikeizbicki.png","language":"Python","readme":"# HTML Validation with Stacks\n[![](https://github.com/mikeizbicki/html_validator/workflows/tests/badge.svg)](https://github.com/mikeizbicki/html_validator/actions?query=workflow%3Atests)\n[![](https://github.com/mikeizbicki/html_validator/workflows/extra_credit/badge.svg)](https://github.com/mikeizbicki/html_validator/actions?query=workflow%3Atests)\n\nYou will implement an extended version of the balanced parentheses algorithm that checks whether html tags are balanced.\n(See [chapter 4.7](https://runestone.academy/runestone/books/published/pythonds/BasicDS/BalancedSymbolsAGeneralCase.html) of the book for details on the balanced parentheses algorithm.)\n\n**Learning Objectives:**\n\n1. implement the balanced parenthesis algorithm\n1. practice using HTML\n1. practice using stacks\n1. practice using pytest and test driven development\n\n## Background\n\nHTML is how webpages format their content.\nA simple example is the following code:\n\n```\nData structures is \u003cstrong\u003ethe best\u003c/strong\u003e!\n```\n\nWhich results in text that looks like: Data structures is \u003cstrong\u003ethe best\u003c/strong\u003e!\n\nThe text between angle brackets is called a tag,\nand tags always come in pairs.\nThe first tag (`\u003cstrong\u003e`) is called an opening tag and the second tag (`\u003c/strong\u003e`) is called a closing tag.\nClosing tags always have the same text as an opening tag, except that a slash `/` is added at the very beginning.\n\nThere are many html tags that control different formatting options,\nand they get combined in complex ways to generate the layout of webpages.\nFor example, the `\u003cem\u003e` tag causes text to be italicized and the `\u003cu\u003e` tag causes text to be underlined.\nThe HTML:\n\n```\n\u003cu\u003eData structures\u003c/u\u003e is \u003cstrong\u003ethe \u003cem\u003ebest\u003c/em\u003e\u003c/strong\u003e!\n```\n\nresults in text that looks like: \u003cu\u003eData structures\u003c/u\u003e is \u003cstrong\u003ethe \u003cem\u003ebest\u003c/em\u003e\u003c/strong\u003e!\n\nLarge webpages have tens of thousands of html tags in a single file,\nand it is important to verify that this html is correct.\nExamples of incorrect html are:\n\n1. `\u003cstrong\u003eexample` (there is no closing `\u003c/strong\u003e` tag)\n1. `\u003cstrong\u003epython \u003cu\u003eis \u003c/strong\u003e awesome \u003c/u\u003e` (the `\u003c/strong\u003e` closing tag needs to be outside of the `\u003c/u\u003e` tag)\n\nThe goal of this assignment is to write a program which can detect these HTML errors.\n\n**Real World Application:**\nThe [World Wide Web Consortium (W3C)](https://w3.org) is the organization responsible for maintaining the HTML standard.\nThey have a program online at https://validator.w3.org/ which performs HTML validation,\nand it is used by web developers around the world to improve their webpages.\nYou are implementing a limited version of this program.\n\n## Tasks\n\nComplete the following tasks:\n\n1. Fork the [html\\_validator repo](https://github.com/mikeizbicki/html_validator) and enable github actions\n1. Update the `README.md` file so that the test case badges point to your forked repo\n1. Implement the `validate_html` and `_extract_tags` functions so that all test cases in `tests/test_main.py` pass\n\n## Extra Credit: HTML Attributes\n\nThe function of many HTML tags can be modified by specifying attributes within the opening tag.\nFor example:\n```\nThis is a hyperlink to \u003ca href=\"https://izbicki.me\"\u003emy webpage\u003c/a\u003e.\n```\nThe `a` tag creates a hyperlink, and the `href` attribute specifies where the link goes.\nNotice that the `href` attribute appears only in the opening tag and not in the closing tag.\n\nThe file `tests/test_ec.py` contains test cases for HTML that includes attributes.\nIf your code successfully passes all of these test cases, then you will get 1 point of extra credit on the assignment. \nYou must pass all of the test cases and get the green extra credit badge in order to get this point.\n\n**HINT:**\nYou do not need to modify the `validate_html` function at all.\nInstead, just modify the `_extract_tags` function so that it ignores any attributes present in the opening tag.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikeizbicki%2Fhtml_validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikeizbicki%2Fhtml_validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikeizbicki%2Fhtml_validator/lists"}