Changeset e7f85bd in github


Ignore:
Timestamp:
Aug 30, 2008 8:35:36 AM (5 years ago)
Author:
alecpl <alec@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
ade8e11
Parents:
8ac6fd0
Message:
  • applied RC's patches after html2text update
File:
1 edited

Legend:

Unmodified
Added
Removed
  • program/lib/html2text.php

    r8ac6fd0 re7f85bd  
    315315    var $_link_count = 0; 
    316316 
     317    /**  
     318     * Boolean flag, true if a table of link URLs should be listed after the text.  
     319     *   
     320     * @var boolean $_do_links  
     321     * @access private  
     322     * @see html2text()  
     323     */ 
     324    var $_do_links = true; 
     325  
    317326    /** 
    318327     *  Constructor. 
     
    324333     *  @param string $source HTML content 
    325334     *  @param boolean $from_file Indicates $source is a file to pull content from 
    326      *  @access public 
    327      *  @return void 
    328      */ 
    329     function html2text( $source = '', $from_file = false ) 
     335     *  @param boolean $do_links Indicate whether a table of link URLs is desired 
     336     *  @param integer $width Maximum width of the formatted text, 0 for no limit 
     337     *  @access public 
     338     *  @return void 
     339     */ 
     340    function html2text( $source = '', $from_file = false, $do_links = true, $width = 75 ) 
    330341    { 
    331342        if ( !empty($source) ) { 
    332343            $this->set_html($source, $from_file); 
    333344        } 
     345         
    334346        $this->set_base_url(); 
     347        $this->_do_links = $do_links; 
     348        $this->width = $width; 
    335349    } 
    336350 
     
    350364        else 
    351365            $this->html = $source; 
    352  
    353366 
    354367        $this->_converted = false; 
     
    496509    function _build_link_list( $link, $display ) 
    497510    { 
    498                 if ( substr($link, 0, 7) == 'http://' || substr($link, 0, 8) == 'https://' || 
     511        if ( !$this->_do_links ) return $display; 
     512         
     513        if ( substr($link, 0, 7) == 'http://' || substr($link, 0, 8) == 'https://' || 
    499514             substr($link, 0, 7) == 'mailto:' ) { 
    500515            $this->_link_count++; 
Note: See TracChangeset for help on using the changeset viewer.