Tuesday, April 12, 2016

Re: Less optimal HTML output?

On Tuesday, April 12, 2016 at 8:44:00 AM UTC-5, Yongwei Wu wrote:
> I noticed something weird recently in the VIM HTML output (CSS on). It
> is probably there for quite some time now, but I checked the HTML
> source only recently.
>
> * { font-size: 1em; } (in CSS)
>
> I do not see the point of this. It does not seem to affect the result
> in Chrome, but it makes the font larger in IE than without it.
>

From 2html.vim:

" fix browser inconsistencies (sometimes within the same browser) of different
" default font size for different elements
call append('.', '* { font-size: 1em; }')

I'm not sure exactly what that means or when it was introduced, but I can look into it. Perhaps there is a better way to accomplish this.

I can confirm that the font gets bigger in IE with that in (actually it makes it match Firefox and Chrome fairly closely). This is weird; in a monospace font 1em should already be the width of a character. Setting it to 100% or 1rem instead of 1em seems to do the same thing. Ugh...IE.

Why is the larger text a problem? I figured consistency across browsers would be a good thing, not a bad one...

> <script type='text/javascript'>
> <!--
>
> -->
> </script>
>
> Apparently it does nothing, but it triggers the IE warning: "Internet
> Explorer restricted this web page from running scripts or ActiveX
> controls."
>

It's a bug that an empty script tag is generated; apparently you don't have any options enabled that use javascript (dynamic folds, uncopyable regions, jumping to specific lines). Previously the line-jumping script was always added, now it has an option to remove it. Now that the option is there, the <script> tag should also be removed if there will be no content. I just created an issue for this:

https://bitbucket.org/fritzophrenic/vim-tohtml/issues/6/empty-script-tag-should-not-be-generated

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: