On Tue, Jul 15, 2014 at 1:43 PM, Larry Silverman
<[email protected]> wrote:
> Ideas:
> 1) Does ReplaceText support multi-line find-and-replace with captures?
> Perhaps instead of replacing just those tags, you replace the whole <code
> lang="lang">...</code> block, with a capture inside to put the content back
> into the page with the new syntaxhighlight syntax.

Nope, it just supports string replacement.  It does support Regular
Expressions, but a limited version.  It doens't allow for greedy
matches which would allow for me to capture the correct blocks.

> 2) How many <code></code> pages are there? If not many, get a list of them.
> Then either change just those pages to something else
> <tempcode></tempcode>, then do all your syntaxhighlight pages, then come
> back and replace tempcode with code. Basically, change them so they won't
> be found by your main ReplaceText run.

This approach may have potential.  It's that closing tag that's killing me.

> 3) There may be some scripts in the maintenance folder that can do this, or
> could have more power than ReplaceText to do regex captures.

I'll have a look.

Thanks.
>
> Larry Silverman
> Chief Technology Officer
> TrackAbout, Inc.
>
>
> On Tue, Jul 15, 2014 at 12:30 PM, Bill Traynor <[email protected]> wrote:
>
>> I have about 400 pages in a wiki I'm administering that use
>> syntaxhighlighting using the old <code lang="lang">some code
>> here</code> method provided by and extension called
>> CodeSyntaxHighlight.
>>
>> I'd like to remove the old extension and use SyntaxHighlight_GeSHi
>> going forward.  To do this, I need to replace:
>>
>> <code lang="lang"> with <syntaxhighlight lang="lang">
>> and
>> </code> with </syntaxhighlight>
>>
>> Using the ReplaceText extension is one possibility, but I keep ending
>> up with a problem when <code></code> is used, as the closing tag gets
>> replaced and breaks the formatting.
>>
>> Is there some magic regular expression that can do this?  I'm working
>> through these pages manually right now.
>>
>> Thanks
>> Bill
>>
>> _______________________________________________
>> MediaWiki-l mailing list
>> To unsubscribe, go to:
>> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>>
> _______________________________________________
> MediaWiki-l mailing list
> To unsubscribe, go to:
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

Reply via email to