Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 21... Línea 21...
21
 *
21
 *
22
 * @package    core
22
 * @package    core
23
 * @copyright  2015 Andrew Nicols <andrew@nicols.uk>
23
 * @copyright  2015 Andrew Nicols <andrew@nicols.uk>
24
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
24
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
25
 */
25
 */
26
 
-
 
27
defined('MOODLE_INTERNAL') || die();
-
 
28
 
-
 
29
require_once($CFG->libdir . '/html2text/Html2Text.php');
-
 
30
require_once(__DIR__ . '/override.php');
-
 
31
 
-
 
32
/**
-
 
33
 * Wrapper for Html2Text
-
 
34
 *
-
 
35
 * This wrapper allows us to modify the upstream library without hacking it too much.
-
 
36
 *
-
 
37
 * @package    core
-
 
38
 * @copyright  2015 Andrew Nicols <andrew@nicols.uk>
-
 
39
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
-
 
40
 */
-
 
41
class core_html2text extends \Html2Text\Html2Text {
26
class core_html2text extends \Html2Text\Html2Text {
42
 
-
 
43
    /**
27
    /**
44
     * Constructor.
28
     * Constructor.
45
     *
29
     *
46
     * If the HTML source string (or file) is supplied, the class
30
     * If the HTML source string (or file) is supplied, the class
47
     * will instantiate with that source propagated, all that has
31
     * will instantiate with that source propagated, all that has
Línea 56... Línea 40...
56
 
40
 
57
        // MDL-27736: Trailing spaces before newline or tab.
41
        // MDL-27736: Trailing spaces before newline or tab.
58
        $this->entSearch[] = '/[ ]+([\n\t])/';
42
        $this->entSearch[] = '/[ ]+([\n\t])/';
59
        $this->entReplace[] = '\\1';
43
        $this->entReplace[] = '\\1';
60
    }
-
 
61
 
-
 
62
    /**
-
 
63
     * Strtoupper multibyte wrapper function with HTML entities handling.
-
 
64
     *
-
 
65
     * @param string $str Text to convert
-
 
66
     * @return string Converted text
-
 
67
     */
-
 
68
    protected function strtoupper($str) {
-
 
69
        return core_text::strtoupper($str);
-
 
70
    }
44
    }