Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tag-pair points to the wrong line #1284

Open
ebiscaia opened this issue Feb 22, 2023 · 1 comment · May be fixed by #1413
Open

tag-pair points to the wrong line #1284

ebiscaia opened this issue Feb 22, 2023 · 1 comment · May be fixed by #1413
Labels
bug Functionality that does not work as intended/expected help wanted We are looking for community help keep-unstale The issue will not be marked as stale by the stale-bot

Comments

@ebiscaia
Copy link

ebiscaia commented Feb 22, 2023

I have the following html file:

<!DOCTYPE html>    
  <html>      
              
  <head>      
    <meta name="description" content="This is a learning page" />                                                                             
    <title>My first webpage</title>                                                                                                           
    <link rel='icon' type="image/x-icon" href="html5.png" />                                                                                  
    <link rel="stylesheet" type="text/css" href="style.css" />                                                                                
  </head>     
              
  <body>      
    <h1>Hello World                                                                                                                           
    <hr />                                                                                                                                    
    <article>                                                                                                                                 
      <h2>I'm ready to learn HTML</h2>                                                                                                        
      <p>&nbsp;&le;This is my first webpage</p>                                                                                               
      <h3>My daily schedule,</h3>                                                                                                             
      <p>Lemme tell ya how I learnt it:</p>                                                                                                   
    </article>                                                                                                                                
                                                                                                                                              
    <ol>                                                                                                                                      
      <li>...I plan my schedule</li>                                                                                                          
      <li>...I use resources from <abbr title="W3Schools">W3S</abbr>.</li>                                                                    
    </ol>                                                                                                                                     
                                                                                                                                              
    <h4>I live here:</h4>                                                                                                                     
    <address>77/555 Crisp Biscuit, Lucy</address>                                                                                              
    <hr />                                                                                                                                    
  </body>     
              
  </html>

I ran htmlhint and I have got the following results:

html/index.html|7 col 8 error| The value of attribute [ rel ] must be in double quotes. [error/attr-value-double-quotes]                
html/index.html|29 col 1 error| Tag must be paired, missing: [ </h1> ], start tag match failed [ <h1> ] on line 12. [error/tag-pair]

As you guys can see, htmlhint is first saying that the problem is in line 29 and then in line 12. Is it possible to correct that?

Thanks

@coliff coliff added bug Functionality that does not work as intended/expected help wanted We are looking for community help labels Feb 22, 2023
@stale stale bot added the bot:stale Issue marked as stale because there was no activity label May 20, 2023
@stale stale bot closed this as completed Jun 10, 2023
@coliff coliff reopened this Jun 12, 2023
@coliff coliff added bot:stale Issue marked as stale because there was no activity keep-unstale The issue will not be marked as stale by the stale-bot and removed bot:stale Issue marked as stale because there was no activity labels Jun 12, 2023
@stale stale bot removed the bot:stale Issue marked as stale because there was no activity label Jun 12, 2023
@htmlhint htmlhint deleted a comment from stale bot Jun 12, 2023
@silambu215
Copy link

silambu215 commented Oct 7, 2023

I have the following html file:

<!DOCTYPE html>    
  <html>      
              
  <head>      
    <meta name="description" content="This is a learning page" />                                                                             
    <title>My first webpage</title>                                                                                                           
    <link rel='icon' type="image/x-icon" href="html5.png" />                                                                                  
    <link rel="stylesheet" type="text/css" href="style.css" />                                                                                
  </head>     
              
  <body>      
    <h1>Hello World                                                                                                                           
    <hr />                                                                                                                                    
    <article>                                                                                                                                 
      <h2>I'm ready to learn HTML</h2>                                                                                                        
      <p>&nbsp;&le;This is my first webpage</p>                                                                                               
      <h3>My daily schedule,</h3>                                                                                                             
      <p>Lemme tell ya how I learnt it:</p>                                                                                                   
    </article>                                                                                                                                
                                                                                                                                              
    <ol>                                                                                                                                      
      <li>...I plan my schedule</li>                                                                                                          
      <li>...I use resources from <abbr title="W3Schools">W3S</abbr>.</li>                                                                    
    </ol>                                                                                                                                     
                                                                                                                                              
    <h4>I live here:</h4>                                                                                                                     
    <address>77/555 Crisp Biscuit, Lucy</address>                                                                                              
    <hr />                                                                                                                                    
  </body>     
              
  </html>

I ran htmlhint and I have got the following results:

html/index.html|7 col 8 error| The value of attribute [ rel ] must be in double quotes. [error/attr-value-double-quotes]                
html/index.html|29 col 1 error| Tag must be paired, missing: [ </h1> ], start tag match failed [ <h1> ] on line 12. [error/tag-pair]

As you guys can see, htmlhint is first saying that the problem is in line 29 and then in line 12. Is it possible to correct that?

Try this below code

<!DOCTYPE html>    
  <html>      
              
  <head>      
    <meta name="description" content="This is a learning page" />                                                                             
    <title>My first webpage</title>                                                                                                           
    <link rel="icon" type="image/x-icon" href="html5.png" />                                                                                  
    <link rel="stylesheet" type="text/css" href="style.css" />                                                                                
  </head>     
              
  <body>      
    <h1>Hello World</h1>                                                                                                                         
    <hr />                                                                                                                                    
    <article>                                                                                                                                 
      <h2>I'm ready to learn HTML</h2>                                                                                                        
      <p>&nbsp;&le;This is my first webpage</p>                                                                                               
      <h3>My daily schedule,</h3>                                                                                                             
      <p>Lemme tell ya how I learnt it:</p>                                                                                                   
    </article>                                                                                                                                
                                                                                                                                              
    <ol>                                                                                                                                      
      <li>...I plan my schedule</li>                                                                                                          
      <li>...I use resources from <abbr title="W3Schools">W3S</abbr>.</li>                                                                    
    </ol>                                                                                                                                     
                                                                                                                                              
    <h4>I live here:</h4>                                                                                                                     
    <address>77/555 Crisp Biscuit, Lucy</address>                                                                                              
    <hr />                                                                                                                                    
  </body>     
              
  </html>

bebehr added a commit to bebehr/HTMLHint that referenced this issue Feb 18, 2024
… tag if no end tag was provided

Do not report where the missing end tag should be closed at the latest, but the start tag.

fix htmlhint#1284
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Functionality that does not work as intended/expected help wanted We are looking for community help keep-unstale The issue will not be marked as stale by the stale-bot
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants