Fix so links with href == content aren't added to links list on html to text conversion (#1490434)
| | |
| | | - Fix unintentional messages list page change on page switch in compose addressbook (#1490427) |
| | | - Fix race-condition in saving user preferences and loading plugin config (#1490431) |
| | | - Fix so plain text signature field uses monospace font (#1490435) |
| | | - Fix so links with href == content aren't added to links list on html to text conversion (#1490434) |
| | | |
| | | RELEASE 1.1.2 |
| | | ------------- |
| | |
| | | |
| | | // Ignored link types |
| | | if (preg_match('!^(javascript:|mailto:|#)!i', $link)) { |
| | | return $display; |
| | | } |
| | | |
| | | // skip links with href == content (#1490434) |
| | | if ($link === $display) { |
| | | return $display; |
| | | } |
| | | |
| | |
| | | |
| | | $this->assertContains('QUOTED TEXT INNER 1 INNER 2 NO END', $res, 'No quoating on invalid html'); |
| | | } |
| | | |
| | | function test_links() |
| | | { |
| | | $html = '<a href="http://test.com">content</a>'; |
| | | $expected = 'content [1] |
| | | |
| | | Links: |
| | | ------ |
| | | [1] http://test.com |
| | | '; |
| | | |
| | | $ht = new rcube_html2text($html, false, true); |
| | | $res = $ht->get_text(); |
| | | |
| | | $this->assertSame($expected, $res, 'Links list'); |
| | | |
| | | // href == content (#1490434) |
| | | $html = '<a href="http://test.com">http://test.com</a>'; |
| | | $expected = 'http://test.com'; |
| | | |
| | | $ht = new rcube_html2text($html, false, true); |
| | | $res = $ht->get_text(); |
| | | |
| | | $this->assertSame($expected, $res, 'Skip link with href == content'); |
| | | } |
| | | } |