mirror of
https://github.com/neocities/neocities.git
synced 2025-07-20 17:46:05 +02:00
fix up highlight.js support and add syntax for code examples, few homework check fixes
This commit is contained in:
parent
1f6ef958dc
commit
c133252cb6
74 changed files with 29 additions and 4930 deletions
|
@ -13,26 +13,19 @@
|
|||
|
||||
<div class="welcome">
|
||||
<h4>Nesting</h4>
|
||||
<p>Tags always need to be nested properly, like Russian dolls. So this is okay:
|
||||
<pre>
|
||||
<p>Welcome! <a href="//neocities.org">Link!</a></p>
|
||||
</pre>
|
||||
<p>
|
||||
Tags always need to be nested properly, like Russian dolls. So this is okay:
|
||||
<pre><code class="html"><%= erb '<p>Welcome! <a href="//neocities.org">Link!</a></p>', layout: false %></code></pre>
|
||||
|
||||
But this is not correct:
|
||||
But this is not correct:
|
||||
|
||||
<pre>
|
||||
<p>Welcome! <a href="//neocities.org">Link!</p></a>
|
||||
</pre>
|
||||
</p>
|
||||
<pre><code class="html"><%= erb '<p>Welcome! <a href="//neocities.org">Link!</p></a>', layout: false %></code></pre>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function checkHomework() {
|
||||
var html = editor.getValue()
|
||||
/* TODO: Make .+ ignore any spaces or newlines or whatever. </a> lol </p> is fine too. */
|
||||
var match = '<html.+>.+<body>.+<h1>.+</h1>.+<p>.+<a.+href=".+">.+</a>[^.+]?</p>.+</body>.+</html>'
|
||||
var re = new XRegExp(match, 'gis')
|
||||
|
||||
var p = preview().find('p')
|
||||
|
||||
if(p.length == 0) {
|
||||
|
@ -57,7 +50,7 @@ But this is not correct:
|
|||
return
|
||||
}
|
||||
|
||||
if(a.text() == '' || a.text().match(/\s+/)) {
|
||||
if(a.text() == '') {
|
||||
notok('You need to add a name for your link, which is the text between the <a> tag, and the closing tag </a>')
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue