Skip to content

cxq0517/htmltool2

Repository files navigation

HTML Visual Editor

A tiny, fully local WYSIWYG HTML editor for making quick text and color changes to single-page HTML files, especially pages generated by AI tools.

The simplest HTML text editor. Edit text directly on an HTML page while preserving the original rendered appearance. Now you can quickly fine-tune any AI-generated HTML file, such as presentations, resumes, infographics, and more.

It focuses on two jobs:

  • Click page text and edit it directly
  • Click empty space inside an element and adjust background or text color

Everything else, including structure, layout, CSS, images, and animations, is preserved as much as possible.

中文说明

Features

  • Single-file app: open index.html and start editing
  • Fully local: file loading, editing, and saving happen in your browser
  • No build step: no Node.js, bundler, or backend required
  • Safer preview: scripts inside the edited HTML are disabled by default
  • Interactive preview: optionally enable scripts for animated decks, page flipping, and JavaScript-driven pages
  • Plain-text editing: pasted content is inserted without rich formatting
  • Color panel: edit background color, text color, HEX values, and preset swatches
  • Change status: see whether the current file has unsaved edits
  • Drag and drop: drop .html / .htm files into the window
  • Image preservation: loaded <img> assets are inlined when saving whenever the browser allows it

Quick Start

Open this file in a browser:

index.html

Then click "Open HTML" or drag an HTML file into the window.

If your HTML depends on relative local assets such as ./style.css or ./image.png, run a local static server from the project directory:

python -m http.server 8765

Then open:

http://127.0.0.1:8765/index.html

Usage

  1. Open index.html
  2. Click "Open HTML" or drop an HTML file into the window
  3. Turn on "Edit mode"
  4. Click text to edit it
  5. Click empty space inside an element, or use the floating color button, to open the color panel
  6. Click "Save" to download original-name-edited.html

For animated HTML presentations or page-flipping files, turn on "Interactive preview" before editing. This lets the page's own JavaScript initialize slides, animations, and navigation.

Shortcuts:

Shortcut Action
Ctrl / Cmd + S Save current result
Esc Close the color panel

Security Notes

The editor previews user HTML in an iframe and does not grant allow-scripts by default, so scripts inside the edited page do not run unless you enable "Interactive preview". This reduces the chance that an untrusted HTML file can affect the editor itself.

Please still keep these points in mind:

  • Do not edit untrusted HTML that contains sensitive information
  • Only enable "Interactive preview" for trusted local or AI-generated files
  • Saved output comes from browser DOM serialization and may not match the exact original formatting
  • Pages that rely on runtime JavaScript rendering may not display generated content in the default preview

Known Limitations

  • Saved HTML may differ in whitespace, attribute order, and serialization details
  • Structural editing is intentionally unsupported
  • Color edits are written as inline styles
  • Relative assets may not resolve from the original HTML file location when using srcdoc
  • Images that cannot be fetched by the browser are kept as their original paths
  • JavaScript-driven pages need "Interactive preview" enabled before editing
  • Firefox support for contenteditable="plaintext-only" differs from Chromium browsers

Browser Compatibility

Latest Chrome or Edge is recommended.

Safari and Firefox may work, but editing behavior and color picker behavior can differ.

Project Structure

.
+-- index.html        # The editor
+-- test.html         # Example test page
+-- README.md         # English README
+-- README.zh.md      # Chinese README
+-- LICENSE           # MIT License
+-- CONTRIBUTING.md   # Contribution guide
+-- SECURITY.md       # Security policy
+-- CHANGELOG.md      # Release notes

Roadmap

  • Undo / redo
  • Multi-file tabs
  • Font size and font family editing
  • Gradient background editing
  • More precise text-node editing mode
  • Optional script-enabled preview mode
  • Chrome extension version

Contributing

Issues and pull requests are welcome. Please read CONTRIBUTING.md before contributing.

License

MIT

About

最简洁的html文字编辑器,可以直接修改html上的文字,并保证原渲染效果不变。现在可以随时微调你用AI生成的html格式的ppt、简历、信息图等各种html文件。The simplest HTML text editor. Edit text directly on an HTML page while preserving the original rendered appearance. Now you can quickly fine-tune any AI-generated HTML file, such as presentations, resumes, infographics, and more.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages