https://github.com/markbattistella/markdown-safe-link
Scan your markdown files for unsafe urls and remove them so you don't get spread bad stuff!
https://github.com/markbattistella/markdown-safe-link
google-safe-browsing google-safebrowsing node nodejs safe-browsing sanitizer url-safe
Last synced: 4 months ago
JSON representation
Scan your markdown files for unsafe urls and remove them so you don't get spread bad stuff!
- Host: GitHub
- URL: https://github.com/markbattistella/markdown-safe-link
- Owner: markbattistella
- License: mit
- Created: 2020-12-05T00:35:39.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2025-09-13T12:35:27.000Z (9 months ago)
- Last Synced: 2025-10-20T00:14:51.436Z (8 months ago)
- Topics: google-safe-browsing, google-safebrowsing, node, nodejs, safe-browsing, sanitizer, url-safe
- Language: JavaScript
- Homepage: https://markbattistella.github.io/markdown-safe-link/
- Size: 237 KB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Markdown Safe Web Browsing
[](https://www.paypal.me/markbattistella/6AUD)
[](https://www.buymeacoffee.com/markbattistella)
---
## Background
I started with this tweet by [@seanallen](https://twitter.com/seanallen_dev/status/1332696819625844736) where he added a URL into a YouTube video description.
The URL became compromised within the week of adding it, and his channel was flagged with **strike 1**.
I realised there isn't anything out there to prevent this from happening to anyone's repository.
## Usage
1. Install the module from `npm`
```sh
# locally
npm i @markbattistella/markdown-safe-link
# globally
npm i @markbattistella/markdown-safe-link -g
```
1. Run it from your terminal
```sh
markdown-safe-link \
--api="" \
--dir="~/projects/my-docs/" \
--replace="~~UNSAFE~~"
```
### Github action
If you want to use this as part of your repository there is also [an action you can use](https://github.com/markbattistella/markdown-safe-link-action).
## Requirements
You need to get your own API for [Google Safe Browsing](https://developers.google.com/safe-browsing/) as there are limits to the number of calls made.
## Configuration
| Name | Description |
|------------|---------------------------------|
| `dir` | The directory to scan md files |
| `api` | Google API for scanning URLs |
| `replace` | What to replace the URLs with |
| `proxy` | Are you behind a proxy server |
| `url` | Proxy url address or IP address |
| `port` | Proxy port number |
| `username` | Username if your proxy has auth |
| `password` | Password if your proxy has auth |
| `dry` | Don't actually re-write files |
| `help` | Display the help screen |
### Full command line
```sh
markdown-safe-link \
--api="" \
--dir="~/projects/my-docs/" \
--replace="~~UNSAFE~~" \
--proxy \
--url="127.0.0.1" \
--port="3128" \
--username="jdoe" \
--password="MyPassword" \
--dry
```
## Contributing
1. Clone the repo:
`git clone https://github.com/markbattistella/markdown-safe-link.git`
1. Create your feature branch:
`git checkout -b my-feature`
1. Commit your changes:
`git commit -am 'Add some feature'`
1. `Push` to the branch:
`git push origin my-new-feature`
1. Submit the `pull` request