0

I should of asked my question better so I'm asking it again. I'm creating a book review site for users using python, mongo and flask.

I've got my books to be displayed in card format. The card holds the book information such title, author and rating. I've also included a purchase link for the user once the book has been reviewed and added to the site.

My purchase-link is under a add_book function:

def add_book():


and the html in each of my book cards is, "which is a if.session":

 <h5><a href="{{- book.purchase_link -}}"> Purchase Link</a></h5>

Now the reason for my question here is that, all 20+ books that have posted by my users are coming up as validator errors*

In validator, I'm getting,

Bad value https://www.amazon.co.uk/s?k=Beneath the Lion's Gaze for attribute href on element a: Illegal character in query: space is not allowed.

My line for the purchase link:

<h5><a href="https://www.amazon.co.uk/s?k=Beneath the Lion&#39;s Gaze">Purchase Link</a></h5>

I'm getting a validator error for all books that are being added. How can I get round this exactly and what is validator referring to with illegal character character and space is not allowed?

Ryu
  • 1
  • 3

0 Answers0