fix for tutorial not accepting spaces in link text

This commit is contained in:
Kyle Drake 2024-01-22 14:40:02 -06:00
parent 2e2ddec790
commit 0fe2bcb649
2 changed files with 2 additions and 2 deletions

View file

@ -24,6 +24,7 @@ end
get '/tutorial/:section/?' do
require_login
not_found unless %w{html css js}.include?(params[:section])
redirect "/tutorial/#{params[:section]}/1"
end

View file

@ -38,8 +38,7 @@
notok('You need to add an <strong>href</strong> to your <strong>a</strong> tag, like: <strong>href="http://neocities.org"</strong>')
return
}
if(a.text() == '' || a.text().match(/\s+/)) {
if(a.text() == '' || !a.text().match(/[^\s]+/)) {
notok('You need to add a name for your link, which is the text between the &lt;a&gt; tag, and the closing tag &lt;/a&gt;')
return
}