Sunday, July 1, 2012

Release candidate of TOhtml

Attached is a release candidate for the next update of the TOhtml
standard plugin distributed with the Vim runtime.

The major addition in this release is a new feature to specify areas
of text which do not get copied from a browser showing the rendered
page. Thus, you can copy-paste code from the browser without also
pasting line numbers, fold column, etc.

Please give it a try and reply to this thread (or to me) with any
issues you encounter. Next weekend, I will remove the "rc1" from the
version number and submit this to Bram otherwise unchanged, if there
are no major issues.

Here's the help text added for the new feature:

*TOhtml-uncopyable-text* *g:html_prevent_copy*
Default: empty string.
This option prevents certain regions of the generated HTML from being copied,
when you select all text in document rendered in a browser and copy it. Useful
for allowing users to copy-paste only the source text even if a fold column or
line numbers are shown in the generated content. Specify regions to be
affected in this way as follows:
f: fold column
n: line numbers (also within fold text)
t: fold text
d: diff filler

Example, to make the fold column and line numbers uncopyable: >
:let g:html_prevent_copy = "fn"
<
This feature is currently implemented by inserting read-only <input> elements
into the markup to contain the uncopyable areas. This does not work well in
all cases. When pasting to some applications which understand HTML, the
<input> elements also get pasted. But plain-text paste destinations should
always work.

*g:html_no_invalid*
Default: 0.
When 0, if |g:html_prevent_copy| is non-empty, an invalid attribute is
intentionally inserted into the <input> element for the uncopyable areas. This
increases the number of applications you can paste to without also pasting the
<input> elements. Specifically, Microsoft Word will not paste the <input>
elements if they contain this invalid attribute.
When 1, no invalid markup is ever intentionally inserted, and the generated
page should validate. However, be careful pasting into Microsoft Word when
|g:html_prevent_copy| is non-empty; it can be hard to get rid of the <input>
elements which get pasted.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: