Skip to content

Commit

Permalink
Improved output for text selection and copy/paste
Browse files Browse the repository at this point in the history
Replace text elements (block) with tspan (inline) which seem to cause new lines when copying text.

Remove all whitespace between tspan:s to not cause them to end as whitespace in copied text.

Replace figure space codepoint with normal whitespace and use xml:space="preserve" instead.
Otherwise copied text would include a confusing non-U+0020 whitespace. This also fixes an issue
with Inkscape not rendering underline for a text element with only whitespace.

Have reported bug/issue here https://gitlab.com/inkscape/inbox/-/issues/9621

Note that selecting multiple lines will currently not produce new lines i copied text.

Possibly also fixes issue in Safari with text baseline styling.

Fixes #5
  • Loading branch information
wader committed Dec 2, 2023
1 parent 3272d35 commit 567c207
Show file tree
Hide file tree
Showing 20 changed files with 87 additions and 4,375 deletions.
16 changes: 4 additions & 12 deletions ansitosvg/testdata/charboxfontsize.ansi.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
583 changes: 4 additions & 579 deletions ansitosvg/testdata/colortest.ansi.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
583 changes: 4 additions & 579 deletions ansitosvg/testdata/colortest_slate.ansi.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
583 changes: 4 additions & 579 deletions ansitosvg/testdata/colortest_transparent.ansi.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 4 additions & 6 deletions ansitosvg/testdata/fontname.ansi.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
360 changes: 4 additions & 356 deletions ansitosvg/testdata/fq.ansi.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
82 changes: 4 additions & 78 deletions ansitosvg/testdata/jq.ansi.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 567c207

Please sign in to comment.