Item15015: Unable to escape the removal of bracket links in AttachContentPlugin

pencil
Priority: Normal
Current State: Closed
Released In: n/a
Target Release: minor
Applies To: Extension
Component: AttachContentPlugin
Branches: master
Reported By: BramVanOosterhout
Waiting For:
Last Change By: BramVanOosterhout
-- BramVanOosterhout - 02 Feb 2021

AttachContentPlugin on Line 184 reads:
184   # Turn paragraphs, nops, and bracket links into plain text
185    unless ($keepPars) {
186        $content =~ s/<p\s*\/>/\n/go;
187        $content =~ s/<nop>//goi;
188        $content =~ s/\[\[.+?\]\[(.+?)\]\]/$1/go;
189        $content =~ s/\[\[(.+?)\]\]/$1/go;
190    }
This sequence prevent the escape of the conversion of bracket links to plain text. I.e. the sequence [[ will not prevent the conversion.

I will change the sequence to:
184   # Turn paragraphs, nops, and bracket links into plain text
185    unless ($keepPars) {
186        $content =~ s/<p\s*\/>/\n/go;
187        $content =~ s/\[\[.+?\]\[(.+?)\]\]/$1/go;
188        $content =~ s/\[\[(.+?)\]\]/$1/go;
189        $content =~ s/<nop>//goi;
190    }
which will escape the sequence [[ and hence prevent the conversion.

Implemented on 3 Feb 2012

 
Topic revision: r4 - 03 Feb 2021, BramVanOosterhout - This page was cached on 01 Mar 2021 - 19:03.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy