Added variable precedence

This commit is contained in:
Nate Choe
2022-06-09 05:27:03 -05:00
parent 4d38820911
commit 9e4bc9e89a
4 changed files with 361 additions and 27 deletions

View File

@@ -92,12 +92,29 @@ Result:
</html>
```
A variable expansion can go through multiple variables until one is found.
file.html
```
@!var1,var2,var3@
@=var2 value@
```
Result:
```
value
```
var1 doesn't exist, so ncdg moves on to var2, which does exist, and skips var3.
### Automatic escaping
```
<pre><code>%\
<pre><code>@\
#include <stdio.h>
%</code></pre>
@</code></pre>
```
Result:
@@ -112,15 +129,17 @@ Note that text inside of escaped sections are not minified.
### Excluding minification
```
%&
@&
&
%
this text isn't minified
@
```
Result:
```
&
this text isn't minified
```
Used for legacy web pages on my site that I don't want to update