sublimetext-codeformatter icon indicating copy to clipboard operation
sublimetext-codeformatter copied to clipboard

HTML

Open millan89 opened this issue 7 years ago • 11 comments

screen shot 2017-11-15 at 10 38 38

link tag in link in link ..?

millan89 avatar Nov 15 '17 09:11 millan89

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/>

isalcedo avatar Nov 16 '17 22:11 isalcedo

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 {};


nekromoff avatar Dec 04 '17 13:12 nekromoff

@millan89 you need to post example code not screenshot

thecotne avatar Dec 05 '17 06:12 thecotne

can't reproduce

@millan89 post example code before formating, os and sublime version and your config of codeformatter

thecotne avatar Dec 05 '17 06:12 thecotne

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

millan89 avatar Dec 09 '17 12:12 millan89

Same problem here...

nucklearproject avatar Jan 31 '18 20:01 nucklearproject

Some Problem Here!

marcelloinfoweb avatar Mar 28 '18 14:03 marcelloinfoweb

Some Problem Here!

compil3r avatar Mar 29 '18 18:03 compil3r

Same problem here...

duwangsky avatar Apr 25 '18 12:04 duwangsky

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)

bobbwal avatar Aug 27 '18 11:08 bobbwal

The same problems: #299 #314

Scarboroid avatar Aug 31 '18 02:08 Scarboroid