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

Extra closing tag for <meta ... and <link ....

Open farkasimre opened this issue 7 years ago • 6 comments

Using Sublime 3 - after i run the code formatter - got extra html closing tag in head for <meta.. and <link What should i do to not insert in code?

In inserted code you will see
Thanks!

<head> <meta charset="utf-8"> <meta content="IE=edge" http-equiv="X-UA-Compatible"> <meta content="width=device-width, initial-scale=1" name="viewport"> <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --> <title> Bootstrap 101 Template </title> <link href="https://fonts.googleapis.com/css?family=Cabin|Source+Sans+Pro:300,400,600,700" rel="stylesheet"> <!-- Bootstrap --> <link href="css/bootstrap.css" rel="stylesheet"> <link href="css/main.css" rel="stylesheet"> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </link> </link> </link> </meta> </meta> </meta> </head>

farkasimre avatar Apr 12 '17 14:04 farkasimre

+1

nnguyendinhphong avatar Jun 15 '17 08:06 nnguyendinhphong

+1

compil3r avatar Mar 29 '18 18:03 compil3r

+1

marcelloinfoweb avatar Apr 02 '18 15:04 marcelloinfoweb

+1

MikeRoesgen avatar Apr 19 '18 18:04 MikeRoesgen

set "formatter_version": "regexp" in "codeformatter_html_options in PackageSettings

SmartManoj avatar Jun 07 '18 13:06 SmartManoj

ensure that your HTML code is correctly formatted and does not contain unnecessary closing tags.

Here's the corrected version of your HTML code with the redundant closing tags removed:

<head>
    <meta charset="utf-8">
    <meta content="IE=edge" http-equiv="X-UA-Compatible">
    <meta content="width=device-width, initial-scale=1" name="viewport">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <title>Bootstrap 101 Template</title>
    <link href="https://fonts.googleapis.com/css?family=Cabin|Source+Sans+Pro:300,400,600,700" rel="stylesheet">
    <!-- Bootstrap -->
    <link href="css/bootstrap.css" rel="stylesheet">
    <link href="css/main.css" rel="stylesheet">
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
        <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>

Make sure your HTML code follows this structure without redundant closing tags, and Sublime Text 3 should format it correctly without adding extra closing tags.

For more meaningful insights do check out Full Stack Web Development Courses

DataSciencemumbai avatar Mar 22 '24 13:03 DataSciencemumbai