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
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. 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. 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.
Larry Silverman Chief Technology Officer TrackAbout, Inc.
On Tue, Jul 15, 2014 at 12:30 PM, Bill Traynor btraynor@gmail.com 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
On Tue, Jul 15, 2014 at 1:43 PM, Larry Silverman lsilverman@trackabout.com wrote:
Ideas:
- 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.
- 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.
- 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 btraynor@gmail.com 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
Instead of looking for code lang= just search and replace <code with <syntaxhighlight and </code with </syntaxhighlight
On Tue, Jul 15, 2014 at 1:30 PM, Bill Traynor btraynor@gmail.com 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
On Tue, Jul 15, 2014 at 1:45 PM, John phoenixoverride@gmail.com wrote:
Instead of looking for code lang= just search and replace <code with <syntaxhighlight and </code with </syntaxhighlight
This breaks the closing tags when <code></code> tags are being used.
On Tue, Jul 15, 2014 at 1:30 PM, Bill Traynor btraynor@gmail.com 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
Why it would create a <syntaxhighlight></syntaxhighlight> that shouldnt break anything
On Tue, Jul 15, 2014 at 2:03 PM, Bill Traynor btraynor@gmail.com wrote:
On Tue, Jul 15, 2014 at 1:45 PM, John phoenixoverride@gmail.com wrote:
Instead of looking for code lang= just search and replace <code with <syntaxhighlight and </code with </syntaxhighlight
This breaks the closing tags when <code></code> tags are being used.
On Tue, Jul 15, 2014 at 1:30 PM, Bill Traynor btraynor@gmail.com
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
On Tue, Jul 15, 2014 at 2:06 PM, John phoenixoverride@gmail.com wrote:
Why it would create a <syntaxhighlight></syntaxhighlight> that shouldnt break anything
I see what you mean now. The <syntaxhighlight></syntaxhighlight> that replaces the <code></code> tags will continue to present whatever's between the tags the same way. I do have $wgSyntaxHighlightDefaultLang = "c"; though, but this may be OK.
On Tue, Jul 15, 2014 at 2:03 PM, Bill Traynor btraynor@gmail.com wrote:
On Tue, Jul 15, 2014 at 1:45 PM, John phoenixoverride@gmail.com wrote:
Instead of looking for code lang= just search and replace <code with <syntaxhighlight and </code with </syntaxhighlight
This breaks the closing tags when <code></code> tags are being used.
On Tue, Jul 15, 2014 at 1:30 PM, Bill Traynor btraynor@gmail.com
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
MediaWiki-l mailing list To unsubscribe, go to: https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
On Tue, Jul 15, 2014 at 2:13 PM, Bill Traynor btraynor@gmail.com wrote:
On Tue, Jul 15, 2014 at 2:06 PM, John phoenixoverride@gmail.com wrote:
Why it would create a <syntaxhighlight></syntaxhighlight> that shouldnt break anything
My only issue is that inline <code></code> appears differently from <syntaxhighlight></syntaxhighlight>. Inline <code> tags format the text inline, whereas the <syntaxhighlight> tags create a newline and indent the text with background shading.
See: https://en.wikipedia.org/wiki/User:Wmat/Sandbox
I see what you mean now. The <syntaxhighlight></syntaxhighlight> that replaces the <code></code> tags will continue to present whatever's between the tags the same way. I do have $wgSyntaxHighlightDefaultLang = "c"; though, but this may be OK.
On Tue, Jul 15, 2014 at 2:03 PM, Bill Traynor btraynor@gmail.com wrote:
On Tue, Jul 15, 2014 at 1:45 PM, John phoenixoverride@gmail.com wrote:
Instead of looking for code lang= just search and replace <code with <syntaxhighlight and </code with </syntaxhighlight
This breaks the closing tags when <code></code> tags are being used.
On Tue, Jul 15, 2014 at 1:30 PM, Bill Traynor btraynor@gmail.com
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
MediaWiki-l mailing list To unsubscribe, go to: https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
mediawiki-l@lists.wikimedia.org