32 lines
1.1 KiB
Bash
Executable File
32 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
OUTPUT_FILE="${1:-test.md}"
|
|
|
|
cat > "${OUTPUT_FILE}" <<'EOF'
|
|
# mdlink Test
|
|
|
|
- [ok](https://httpbin.org/status/200)
|
|
- [redirect](http://github.com)
|
|
- [broken](https://httpbin.org/status/404)
|
|
- Naked: https://httpbin.org/status/500
|
|
- 
|
|
|
|
## Additional Cases
|
|
|
|
- [redirect with title](http://github.com "GitHub redirect")
|
|
- [query and fragment](https://example.com/docs?lang=de#intro)
|
|
- [duplicate redirect](http://github.com)
|
|
- [duplicate redirect again](http://github.com)
|
|
- [non-http scheme should be ignored](mailto:team@example.org)
|
|
- [ftp should be ignored](ftp://speedtest.tele2.net)
|
|
- [inline code URL should not be a markdown link](`https://example.org/code`)
|
|
- [image in text should be ignored] text before  text after
|
|
- [parentheses in URL](https://en.wikipedia.org/wiki/Function_(mathematics))
|
|
- [trailing punctuation in sentence] See https://example.org/docs, for details.
|
|
- autolink angle brackets: <https://example.org/autolink>
|
|
- bare www should be ignored: www.example.org
|
|
EOF
|
|
|
|
echo "Generated ${OUTPUT_FILE}"
|