Loading ...
Sorry, an error occurred while loading the content.

Patch 6.2.144

Expand Messages
  • Bram Moolenaar
    Patch 6.2.144 Problem: When g:html_use_css is set the HTML header generated by the 2html script is wrong. Solution: Add the header after adding HREF for
    Message 1 of 1 , Nov 2, 2003
    • 0 Attachment
      Patch 6.2.144
      Problem: When "g:html_use_css" is set the HTML header generated by the
      2html script is wrong.
      Solution: Add the header after adding HREF for links.
      Also use ":normal!" instead of ":normal" to avoid mappings
      getting in the way.
      Files: runtime/syntax/2html.vim


      *** ../vim-6.2.143/runtime/syntax/2html.vim Sat May 31 20:59:11 2003
      --- runtime/syntax/2html.vim Sun Nov 2 17:44:26 2003
      ***************
      *** 1,6 ****
      " Vim syntax support file
      " Maintainer: Bram Moolenaar <Bram@...>
      ! " Last Change: 2003 May 31
      " (modified by David Ne\v{c}as (Yeti) <yeti@...>)

      " Transform a file into HTML, using the current syntax highlighting.
      --- 1,6 ----
      " Vim syntax support file
      " Maintainer: Bram Moolenaar <Bram@...>
      ! " Last Change: 2003 Nov 02
      " (modified by David Ne\v{c}as (Yeti) <yeti@...>)

      " Transform a file into HTML, using the current syntax highlighting.
      ***************
      *** 180,205 ****
      let s:old_magic = &magic
      set magic

      - " The DTD
      - if exists("html_use_css")
      - exe "normal a<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"\n \"http://www.w3.org/TR/html4/strict.dtd\">\n\e"
      - endif
      -
      " HTML header, with the title and generator ;-). Left free space for the CSS,
      " to be filled at the end.
      ! exe "normal a<html>\n<head>\n<title>\e"
      ! exe "normal a" . expand("%:p:~") . "</title>\n\e"
      ! exe "normal a<meta name=\"Generator\" content=\"Vim/" . version/100 . "." . version %100 . "\">\n\e"
      if s:html_encoding != ""
      ! exe "normal a<meta http-equiv=\"content-type\" content=\"text/html; charset=" . s:html_encoding . "\">\n\e"
      endif
      if exists("html_use_css")
      ! exe "normal a<style type=\"text/css\">\n<!--\n-->\n</style>\n\e"
      endif
      if exists("html_no_pre")
      ! exe "normal a</head>\n<body>\n\e"
      else
      ! exe "normal a</head>\n<body>\n<pre>\n\e"
      endif

      wincmd p
      --- 180,200 ----
      let s:old_magic = &magic
      set magic

      " HTML header, with the title and generator ;-). Left free space for the CSS,
      " to be filled at the end.
      ! exe "normal! a<html>\n<head>\n<title>\e"
      ! exe "normal! a" . expand("%:p:~") . "</title>\n\e"
      ! exe "normal! a<meta name=\"Generator\" content=\"Vim/" . version/100 . "." . version %100 . "\">\n\e"
      if s:html_encoding != ""
      ! exe "normal! a<meta http-equiv=\"content-type\" content=\"text/html; charset=" . s:html_encoding . "\">\n\e"
      endif
      if exists("html_use_css")
      ! exe "normal! a<style type=\"text/css\">\n<!--\n-->\n</style>\n\e"
      endif
      if exists("html_no_pre")
      ! exe "normal! a</head>\n<body>\n\e"
      else
      ! exe "normal! a</head>\n<body>\n<pre>\n\e"
      endif

      wincmd p
      ***************
      *** 281,295 ****
      if exists("html_no_pre")
      let s:new = substitute(s:new, ' ', '\ \ ', 'g') . '<br>'
      endif
      ! exe "normal \<C-W>pa" . strtrans(s:new) . "\n\e\<C-W>p"
      let s:lnum = s:lnum + 1
      +
      endwhile
      " Finish with the last line
      if exists("html_no_pre")
      ! exe "normal \<C-W>pa\n</body>\n</html>\e"
      else
      ! exe "normal \<C-W>pa</pre>\n</body>\n</html>\e"
      endif


      --- 276,290 ----
      if exists("html_no_pre")
      let s:new = substitute(s:new, ' ', '\ \ ', 'g') . '<br>'
      endif
      ! exe "normal! \<C-W>pa" . strtrans(s:new) . "\n\e\<C-W>p"
      let s:lnum = s:lnum + 1
      +
      endwhile
      " Finish with the last line
      if exists("html_no_pre")
      ! exe "normal! \<C-W>pa\n</body>\n</html>\e"
      else
      ! exe "normal! \<C-W>pa</pre>\n</body>\n</html>\e"
      endif


      ***************
      *** 313,324 ****
      " incorrect.
      if exists("html_use_css")
      if exists("html_no_pre")
      ! execute "normal A\nbody { color: " . s:fgc . "; background-color: " . s:bgc . "; font-family: Courier, monospace; }\e"
      else
      ! execute "normal A\npre { color: " . s:fgc . "; background-color: " . s:bgc . "; }\e"
      yank
      put
      ! execute "normal ^cwbody\e"
      endif
      else
      if exists("html_no_pre")
      --- 308,319 ----
      " incorrect.
      if exists("html_use_css")
      if exists("html_no_pre")
      ! execute "normal! A\nbody { color: " . s:fgc . "; background-color: " . s:bgc . "; font-family: Courier, monospace; }\e"
      else
      ! execute "normal! A\npre { color: " . s:fgc . "; background-color: " . s:bgc . "; }\e"
      yank
      put
      ! execute "normal! ^cwbody\e"
      endif
      else
      if exists("html_no_pre")
      ***************
      *** 331,337 ****
      " Line numbering attributes
      if s:numblines
      if exists("html_use_css")
      ! execute "normal A\n.lnr { " . s:CSS1(hlID("LineNr")) . "}\e"
      else
      execute '%s+<span class="lnr">\([^<]*\)</span>+' . s:HtmlOpening(hlID("LineNr")) . '\1' . s:HtmlClosing(hlID("LineNr")) . '+g'
      endif
      --- 326,332 ----
      " Line numbering attributes
      if s:numblines
      if exists("html_use_css")
      ! execute "normal! A\n.lnr { " . s:CSS1(hlID("LineNr")) . "}\e"
      else
      execute '%s+<span class="lnr">\([^<]*\)</span>+' . s:HtmlOpening(hlID("LineNr")) . '\1' . s:HtmlClosing(hlID("LineNr")) . '+g'
      endif
      ***************
      *** 350,356 ****
      " its occurences to make the HTML shorter
      if s:attr != ""
      if exists("html_use_css")
      ! execute "normal A\n." . s:id_name . " { " . s:attr . "}"
      else
      execute '%s+<span class="' . s:id_name . '">\([^<]*\)</span>+' . s:HtmlOpening(s:id) . '\1' . s:HtmlClosing(s:id) . '+g'
      endif
      --- 345,351 ----
      " its occurences to make the HTML shorter
      if s:attr != ""
      if exists("html_use_css")
      ! execute "normal! A\n." . s:id_name . " { " . s:attr . "}"
      else
      execute '%s+<span class="' . s:id_name . '">\([^<]*\)</span>+' . s:HtmlOpening(s:id) . '\1' . s:HtmlClosing(s:id) . '+g'
      endif
      ***************
      *** 361,367 ****
      endwhile

      " Add hyperlinks
      ! %s+\(http://\S\{-}\)\(\([.,;:]\=\(\s\|$\)\)\|[\\"'<>]\)+<A HREF="\1">\1</A>\2+ge

      " Cleanup
      %s:\s\+$::e
      --- 356,367 ----
      endwhile

      " Add hyperlinks
      ! %s+\(http://\S\{-}\)\(\([.,;:]\=\(\s\|$\)\)\|[\\"'<>]\|>\|<\)+<A HREF="\1">\1</A>\2+ge
      !
      ! " The DTD
      ! if exists("html_use_css")
      ! exe "normal! ggi<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n\e"
      ! endif

      " Cleanup
      %s:\s\+$::e
      *** ../vim-6.2.143/src/version.c Sun Nov 2 15:49:56 2003
      --- src/version.c Sun Nov 2 17:48:30 2003
      ***************
      *** 639,640 ****
      --- 639,642 ----
      { /* Add new patch number below this line */
      + /**/
      + 144,
      /**/

      --
      Violators can be fined, arrested or jailed for making ugly faces at a dog.
      [real standing law in Oklahoma, United States of America]

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\
      \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
      \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///
    Your message has been successfully submitted and would be delivered to recipients shortly.