1

The error is displayed in the following line:

    link(rel='stylesheet',href='https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css')

below is the markup:

html
  head
    title= title
    link(rel='stylesheet', href='/stylesheets/style.css',type='text/css')
    link(rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css",type='text/css')
  body
    .add-entry
      h3#title Add an entry
        form(id='add', method='post', action='/entry/add')
            .form-group
                label(for='comment') 
                h6  Description:
                input#comment.form-control(rows='5' type='text' size='30' name='description')
            .form-group
                label(for='sev') 
                h6 Severity
                select#sev.form-control(name='severity')
                    option Low
                    option Average
                    option Critical
                br
                br    
                button.btn.btn-primary(type='submit') Submit

Can anyone help? Updated the markup.The error is displayed at line 4

4
  • 1
    FYI, this error would happen if you had indented the line underneath one where the link element is defined.
    – Graham
    Commented Oct 15, 2018 at 2:17
  • yes that was intendation issue..thanks Commented Oct 15, 2018 at 17:49
  • Please mark the answer as "accepted" as it will tag the question as being answered correctly. This lets other users know at a glance that it has a solution when they are searching.
    – Graham
    Commented Oct 15, 2018 at 18:18
  • For me it's the space between link and open parenthesis.
    – f01
    Commented Jan 10, 2021 at 7:17

1 Answer 1

3

This error happens when you indent the line below the link element, like this:

head
    title= title
    link(rel='stylesheet', href='/stylesheets/style.css',type='text/css')
      link(rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css",type='text/css')

This tries to create a link element inside another link element which (as the error says) isn't valid.

In future, make sure all of your link elements are aligned at the same level:

head
    title= title
    link(rel='stylesheet', href='/stylesheets/style.css',type='text/css')
    link(rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css",type='text/css')

Not the answer you're looking for? Browse other questions tagged or ask your own question.