completed jrUrlScan and links as list items

SteveX
SteveX
@ultrajam
7 years ago
2,584 posts
A ul list of urls are not converted to links unless a space is added before the url.

Looking at the jrUrlScan 1.1.12 code, in function jrUrlScan_replace_urls allowances are made for links as the first item in a div or paragraph. If I add similar code for a li everything works as expected.

        // Fix for URLs right after an opening <p> tag which can be added by the editor
        if (strpos(' ' . $text, '<p') || strpos(' ' . $text, '<div') || strpos(' ' . $text, '<li')) {
            $text = preg_replace('`<([p|div|li])([^>]*)>[ \n\t\r]*http`', '<\1\2> http', $text);
        }



--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)

updated by @ultrajam: 10/13/17 01:30:56PM
michael
@michael
7 years ago
7,718 posts
Thanks for finding the problem, then thanks for fixing the problem, then thanks for reporting that it is a problem so it can be fixed up for everyone.

Fixed in next version. jrUrlScan v 1.2.0
SteveX
SteveX
@ultrajam
7 years ago
2,584 posts
My pleasure!

Thank you Michael :)


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)

Tags