development 2.2.0d5 fixing URL wrap bug
git-svn-id: https://plugins.svn.wordpress.org/footnotes/trunk@2435820 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
parent
aeb18f93a6
commit
5091fc4013
5 changed files with 15 additions and 11 deletions
|
@ -26,8 +26,9 @@
|
|||
* 2.1.4 scroll offset and duration settings 2020-12-05T0538+0100
|
||||
* 2.1.4 tooltip display duration settings 2020-12-06T1320+0100
|
||||
* 2.2.0 option to disable URL line wrapping 2020-12-09T1606+0100
|
||||
* 2.2.0 add catch-all exclusion to fix URL line wrapping 2020-12-09T1921+0100
|
||||
*
|
||||
* Last modified: 2020-12-09T1607+0100
|
||||
* Last modified: 2020-12-09T1921+0100
|
||||
*/
|
||||
|
||||
// If called directly, abort:
|
||||
|
@ -518,10 +519,11 @@ class MCI_Footnotes_Task {
|
|||
|
||||
// fix line wrapping of URLs (hyperlinked or not) based on pattern, not link element,
|
||||
// to prevent them from hanging out of the tooltip in non-Unicode-compliant user agents
|
||||
// spare however values of the href and the src arguments!
|
||||
// spare however values of the href and the src arguments!
|
||||
// Even ARIA labels may take an URL as value, so use \w=. as a catch-all.
|
||||
// see public.css
|
||||
if (MCI_Footnotes_Convert::toBool(MCI_Footnotes_Settings::instance()->get(MCI_Footnotes_Settings::C_BOOL_FOOTNOTE_URL_WRAP_ENABLED))) {
|
||||
$l_str_FootnoteText = preg_replace( '#(?<!href=.)(?<!src=.)(https?://[^\\s<]+)#', '<span class="footnote_url_wrap">$1</span>', $l_str_FootnoteText );
|
||||
$l_str_FootnoteText = preg_replace( '#(?<!\w=.)(https?://[^\\s<]+)#', '<span class="footnote_url_wrap">$1</span>', $l_str_FootnoteText );
|
||||
}
|
||||
|
||||
// Text to be displayed instead of the footnote
|
||||
|
|
Reference in a new issue