Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit 76390ef

Browse files
committed
Add initial code
1 parent b69d9c0 commit 76390ef

13 files changed

+22380
-0
lines changed

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
3+
root = true
4+
5+
[*]
6+
end_of_line = lf
7+
insert_final_newline = true
8+
charset = utf-8
9+
indent_style = space
10+
indent_size = 2

.eslintrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "standard",
3+
"rules": {
4+
"comma-dangle": ["error", "always-multiline"],
5+
"no-trailing-spaces": "off"
6+
}
7+
}

.gitignore

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
8+
# Runtime data
9+
pids
10+
*.pid
11+
*.seed
12+
*.pid.lock
13+
14+
# Dependency directories
15+
node_modules/
16+
17+
# Optional npm cache directory
18+
.npm
19+
20+
# Optional eslint cache
21+
.eslintcache
22+
23+
# Optional REPL history
24+
.node_repl_history
25+
26+
# Output of 'npm pack'
27+
*.tgz
28+
29+
# Yarn Integrity file
30+
.yarn-integrity
31+
32+
33+
# Windows thumbnail cache files
34+
Thumbs.db
35+
ehthumbs.db
36+
ehthumbs_vista.db
37+
38+
# Folder config file
39+
Desktop.ini
40+
41+
# Recycle Bin used on file shares
42+
$RECYCLE.BIN/
43+
44+
45+
*.DS_Store
46+
47+
# Thumbnails
48+
._*

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# clean-html-userscript
2+
3+
A JS tool intended to be used as userscript to clean up HTML in a rich text editor in the browser
4+
5+
## Features
6+
7+
* Removes all style attributes from elements and all other unwanted attributes
8+
* Replaces non breaking spaces with normal spaces
9+
* Normalizes some custom Word and LibreOffice Writer formattings (e.g. for unordered lists) to proper HTML
10+
11+
## Setup
12+
13+
### Chrome users
14+
15+
1. Install the [Tampermonkey](https://chrome.google.com/webstore/detail/tampermonkey/dhdgffkkebhmkfjojejmpbldmpobfkfo?hl=en) extension
16+
2. Click on the Tampermonkey extension icon, then on _Dashboard_.
17+
3. Click on the script icon with the green plus sign to create a new script.
18+
4. Paste the contents from [bundle.js](https://github.com/TomOne/clean-html-userscript/raw/master/dist/bundle.js) into the script editor, replacing all previous contents.
19+
5. Hit the save button
20+
21+
To update the userscript, follow step 2, then click on the edit icon with the pencil replace the old script with [bundle.js](https://github.com/TomOne/clean-html-userscript/raw/master/dist/bundle.js).
22+
23+
### Firefox users
24+
25+
TBA
26+
27+
## Usage
28+
29+
Copy the desired HTML into the rich text editor and leave the cursor in the browser’s rich text editor. Then press `ctrl + y` (on Windows and Linux) or `cmd + y` (on macOS) to run the cleanup for the HTML in the editor.
30+
31+
## Browser support
32+
33+
Modern browsers such as Chrome 55+ and Firefox 51+. Other browsers are untested.
34+
35+
## Development
36+
37+
1. Clone this repository
38+
2. Run `npm install` in this directory
39+
3. Run `npm run build` to generate the script bundle ([bundle.js](https://github.com/TomOne/clean-html-userscript/raw/master/dist/bundle.js)) from the source or alternatively `npm run watch` to incrementally build it on every change.

0 commit comments

Comments
 (0)