Skip to content

Commit

Permalink
0.2.11
Browse files Browse the repository at this point in the history
  • Loading branch information
ahaoboy committed Oct 22, 2024
1 parent 931e852 commit bec323c
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = ["ansi2", "ansi2-wasm"]
resolver = "2"

[workspace.package]
version = "0.2.10"
version = "0.2.11"
edition = "2021"
license = "MIT"
description = "ansi2"
Expand Down
2 changes: 1 addition & 1 deletion ansi2-wasm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ansi2",
"version": "0.1.14",
"version": "0.1.15",
"description": "ansi2",
"main": "dist/index.js",
"bin": "./bin/cli.js",
Expand Down
3 changes: 2 additions & 1 deletion ansi2/src/html.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub fn to_html<S: AsRef<str>>(

let mut color256 = HashSet::new();
for row in canvas.pixels.iter() {
s.push_str("<div>");
s.push_str("<div class='row'>");
for c in row.iter() {
let mut text_class = vec!["char".into()];
if c.bold {
Expand Down Expand Up @@ -107,6 +107,7 @@ pub fn to_html<S: AsRef<str>>(
{style}
{color256_str}
.ansi-main{{display:flex;flex-direction:column;}}
.row{{display:flex;}}
.char{{margin:0;padding:0;font-family:{font_family};white-space:pre;display:inline-block;}}</style></head><body>{s}</body></html>
"#
)
Expand Down
3 changes: 1 addition & 2 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
packages:
- 'ansi2-wasm'
- 'ansi-preview'
- 'ansi2-wasm'
3 changes: 2 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,5 @@ ls | table | ansi2 | save nu-ls.svg -f
- [x] link
- [ ] merge characters of the same style to reduce the number of tags
- [x] vscode extension: [preview-easy](https://github.com/ahaoboy/preview-easy.git)
- [ ] ansi minify
- [ ] ansi minify
- [ ] html support copy text, continuous text will be separated by line breaks

0 comments on commit bec323c

Please sign in to comment.