refactor(htlm tags): changed list of html tags to import list

This commit is contained in:
Christopher Pickering 2022-05-17 12:59:33 -05:00
parent 0f698bce19
commit 160dfce6d7
No known key found for this signature in database
GPG key ID: E14DB3B0A0FACF84
4 changed files with 18 additions and 131 deletions

14
poetry.lock generated
View file

@ -77,6 +77,14 @@ tomli = {version = "*", optional = true, markers = "extra == \"toml\""}
[package.extras]
toml = ["tomli"]
[[package]]
name = "html-tag-names"
version = "0.1.2"
description = "List of known HTML tag names"
category = "main"
optional = false
python-versions = ">=3.7,<4.0"
[[package]]
name = "html-void-elements"
version = "0.1.0"
@ -308,7 +316,7 @@ test = ["coverage", "pytest", "pytest-cov"]
[metadata]
lock-version = "1.1"
python-versions = "^3.7,<4.0"
content-hash = "fea66cefbd7968999e5056758a159a08be59079912f90b4ee1ac9e529fbde2ae"
content-hash = "a72c15aeda26733105d97f016255c240b0180f09b404ffde3497271717b4f103"
[metadata.files]
atomicwrites = [
@ -395,6 +403,10 @@ coverage = [
{file = "coverage-6.3.1-pp36.pp37.pp38-none-any.whl", hash = "sha256:463e52616ea687fd323888e86bf25e864a3cc6335a043fad6bbb037dbf49bbe2"},
{file = "coverage-6.3.1.tar.gz", hash = "sha256:6c3f6158b02ac403868eea390930ae64e9a9a2a5bbfafefbb920d29258d9f2f8"},
]
html-tag-names = [
{file = "html-tag-names-0.1.2.tar.gz", hash = "sha256:04924aca48770f36b5a41c27e4d917062507be05118acb0ba869c97389084297"},
{file = "html_tag_names-0.1.2-py3-none-any.whl", hash = "sha256:eeb69ef21078486b615241f0393a72b41352c5219ee648e7c61f5632d26f0420"},
]
html-void-elements = [
{file = "html-void-elements-0.1.0.tar.gz", hash = "sha256:931b88f84cd606fee0b582c28fcd00e41d7149421fb673e1e1abd2f0c4f231f0"},
{file = "html_void_elements-0.1.0-py3-none-any.whl", hash = "sha256:784cf39db03cdeb017320d9301009f8f3480f9d7b254d0974272e80e0cb5e0d2"},

View file

@ -42,6 +42,7 @@ pytest-cov = { version = "^3.0.0", optional = true }
pathspec = "^0.9.0"
importlib-metadata = "^4.11.0"
html-void-elements = "^0.1.0"
html-tag-names = "^0.1.2"
[tool.poetry.dev-dependencies]
black = "^22.1.0"

View file

@ -1,6 +1,7 @@
black==22.1.0; python_full_version >= "3.6.2"
click==8.0.3; python_version >= "3.6"
colorama==0.4.4; (python_version >= "2.7" and python_full_version < "3.0.0") or (python_full_version >= "3.5.0")
html-tag-names==0.1.2; python_version >= "3.7" and python_version < "4.0"
html-void-elements==0.1.0; python_version >= "3.7" and python_version < "4.0"
importlib-metadata==4.11.0; python_version >= "3.7"
isort==5.10.1; python_full_version >= "3.6.1" and python_version < "4.0"

View file

@ -10,11 +10,11 @@ import logging
from pathlib import Path
from typing import Dict, List, Optional, Union
from HtmlVoidElements import html_void_elements
import yaml
from click import echo
from colorama import Fore
from HtmlTagNames import html_tag_names
from HtmlVoidElements import html_void_elements
from pathspec import PathSpec
from pathspec.patterns.gitwildmatch import GitWildMatchPatternError
@ -366,134 +366,7 @@ class Config:
"""
# all html tags possible
self.indent_html_tags: str = (
r""" a
| abbr
| acronym
| address
| applet
| area
| article
| aside
| audio
| b
| base
| basefont
| bdi
| bdo
| big
| blockquote
| body
| br
| button
| canvas
| caption
| center
| cite
| code
| col
| colgroup
| data
| datalist
| dd
| del
| details
| dfn
| dialog
| dir
| div
| dl
| dt
| em
| embed
| fieldset
| figcaption
| figure
| font
| footer
| form
| frame
| frameset
| h1
| h2
| h3
| h4
| h5
| h6
| head
| header
| hr
| html
| i
| iframe
| icon
| img
| input
| ins
| kbd
| label
| legend
| li
| link
| main
| map
| mark
| meta
| meter
| nav
| noframes
| noscript
| object
| ol
| optgroup
| option
| output
| p
| pre
| path
| param
| picture
| progress
| q
| rp
| rt
| ruby
| s
| samp
| script
| section
| select
| small
| source
| span
| strike
| strong
| style
| sub
| summary
| sup
| svg
| table
| tbody
| td
| template
| textarea
| tfoot
| th
| thead
| time
| title
| tr
| track
| tt
| u
| ul
| var
| video
| wbr
"""
+ self.custom_html
)
self.indent_html_tags: str = "|".join(html_tag_names) + self.custom_html
self.indent_template_tags: str = (
r""" if