sublimetext-codeformatter
sublimetext-codeformatter copied to clipboard
HTML
link tag in link in link ..?
Same in case of <br>
, is formated to <br></br>
According to the Google way of code tags like <br>
must be written <br>
not <br/>
If HTML5 declaration is detected, treat empty tags with no end tags as HTML5 Recommendation specififies: https://www.w3.org/TR/html5/text-level-semantics.html#the-br-element
4.5.29 The br element
Categories:
Flow content.
Phrasing content.
Contexts in which this element can be used:
Where phrasing content is expected.
Content model:
Empty.
Content attributes:
Global attributes
Tag omission in text/html:
No end tag
Allowed ARIA role attribute values:
Any role value.
Allowed ARIA state and property attributes:
Global aria-* attributes
Any aria-* attributes applicable to the allowed roles.
DOM interface:
interface HTMLBRElement : HTMLElement {};
@millan89 you need to post example code not screenshot
can't reproduce
@millan89 post example code before formating, os and sublime version and your config of codeformatter
Before formating:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="favicon.ico">
<title>Test</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Montserrat:300,400,600,800">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Caveat:400,700">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="test.css">
<link rel="stylesheet" href="responsive.css">
</head>
<body>
</body>
</html>
Windows 7, sublime text 3 build 3143
I downloaded today again from gitbhub https://github.com/akalongman/sublimetext-codeformatter same thing
Same problem here...
Some Problem Here!
Some Problem Here!
Same problem here...
I commented out the following lines in lib/htmlbeautifier/__init__.py
as a temporary fix. This stops the self closing tags being added. Not sure if it will cause issues elsewhere.
raw = self.singletons.sub(r'<\1\2/>',raw) # Replace all singleton tags with /-delimited tags (XHTML style)
raw = self.singletons.sub(replaceWithSpace,raw)
raw = re.sub(r'(?<!\s)\s(?=/?>)','',raw)
The same problems: #299 #314