Syntax highlighting for code snippets
This commit is contained in:
parent
cb5b87488a
commit
b2d536d07f
@ -58,7 +58,7 @@ the right, we value the items on the left more.
|
||||
|
||||
## Improvements
|
||||
|
||||
```misti
|
||||
```thp
|
||||
use PDO
|
||||
use Globals::Env
|
||||
|
||||
@ -71,9 +71,8 @@ else {
|
||||
die("All 3 db environment variables must be set.")
|
||||
}
|
||||
|
||||
match PDO(dbUri dbUser dbPassword) {
|
||||
Ok(connection) -> { /* db operations */ }
|
||||
Err(pdoException) -> { /* handle exception */ }
|
||||
}
|
||||
match PDO(dbUri dbUser dbPassword)
|
||||
| Ok(connection) { /* db operations */ }
|
||||
| Err(pdoException) { /* handle exception */ }
|
||||
```
|
||||
|
||||
|
@ -15,7 +15,7 @@ Prism.languages.thp = {
|
||||
pattern: /(["])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
|
||||
greedy: true,
|
||||
},
|
||||
"keyword": /\b(?:break|catch|continue|do|else|elif|finally|for|fun|if|in|fn|nil|return|throw|try|while|val|var|type|match|with|of|abstract|class|interface|private|public|override|open)\b/,
|
||||
"keyword": /\b(?:static|const|enum|loop|use|break|catch|continue|do|else|finally|for|fun|if|in|fn|nil|return|throw|try|while|val|var|type|match|with|of|abstract|class|interface|private|public|override|open)\b/,
|
||||
"number": /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
|
||||
"operator": /[<>]=?|[!=]=?=?|--?|\$|\+\+?|&&?|\|\|?|[?*/~^%]/,
|
||||
"punctuation": /[{}[\];(),.]/,
|
||||
|
@ -58,5 +58,8 @@
|
||||
{{markdown}}
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<script src="/js/prism.min.js"></script>
|
||||
<script src="/js/prism.thp.js"></script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user