Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rmcastil/Twiki-to-Mediawiki
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: ABTech/Twiki-to-Mediawiki
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on May 22, 2022

  1. escape left braces

    DaAwesomeP committed May 22, 2022
    Copy the full SHA
    71e7517 View commit details
Showing with 12 additions and 12 deletions.
  1. +12 −12 twiki2mediawiki.pl
24 changes: 12 additions & 12 deletions twiki2mediawiki.pl
Original file line number Diff line number Diff line change
@@ -162,9 +162,9 @@
q#s/%TWIKIWEB%/TWiki/g#,

# ICON
q#s/%ICON{\"?(.+?)\"?}%/<img src="%ICONURLPATH{$1}%"\/>/g#, # will get expanded again by %ICONURLPATH% rule
q#s/%ICONURL{\"?(.+?)\"?}%/%ICONURLPATH{$1}%/g#, # will get expanded again by %ICONURLPATH% rule
q#s/%ICONURLPATH{\"?(.+?)\"?}%/%PUBURL%\/TWiki\/TWikiDocGraphics\/$1.gif/g#, # will get expanded again by %PUBURL% rule
q#s/%ICON\{\"?(.+?)\"?}%/<img src="%ICONURLPATH{$1}%"\/>/g#, # will get expanded again by %ICONURLPATH% rule
q#s/%ICONURL\{\"?(.+?)\"?}%/%ICONURLPATH{$1}%/g#, # will get expanded again by %ICONURLPATH% rule
q#s/%ICONURLPATH\{\"?(.+?)\"?}%/%PUBURL%\/TWiki\/TWikiDocGraphics\/$1.gif/g#, # will get expanded again by %PUBURL% rule

# ATTACHURL, PUBURL
q#s/%ATTACHURL%\//attachmentLinkPrefix($web,$topic)/ge#,
@@ -177,28 +177,28 @@
q#s/%DISPLAYTIME%/{{CURRENTYEAR}}-{{CURRENTMONTH}}-{{CURRENTDAY}} {{CURRENTTIME}/g#,

# %META%
q#s/^%META:TOPICINFO{author="(.*?)" date="(.*?)".*/setTopicInfo($1,$2)/ge#, # %META:TOPICINFO
q#s/^%META:FILEATTACHMENT{(.*)}%/addAttachment($1,$web,$topic)/ge#, # %META:FILEATTACHMENT
q#s/^%META:TOPICINFO\{author="(.*?)" date="(.*?)".*/setTopicInfo($1,$2)/ge#, # %META:TOPICINFO
q#s/^%META:FILEATTACHMENT\{(.*)}%/addAttachment($1,$web,$topic)/ge#, # %META:FILEATTACHMENT
q#s/^%META.*//g#, # Remove remaining meta tags

# %INCLUDE%
q#s/%INCLUDE{\s*(?:$web\.|)([$man]*?)\s*}%/{{:<nop>$1}}/g#,
q#s/%INCLUDE{\s*"(?:$web\.|)([$man]*?)".*?}%/{{:<nop>$1}}/g#,
q#s/%INCLUDE{.*?}%//g#, # remove remaining %INCLUDE{...}%'s
q#s/%INCLUDE\{\s*(?:$web\.|)([$man]*?)\s*}%/{{:<nop>$1}}/g#,
q#s/%INCLUDE\{\s*"(?:$web\.|)([$man]*?)".*?}%/{{:<nop>$1}}/g#,
q#s/%INCLUDE\{.*?}%//g#, # remove remaining %INCLUDE{...}%'s
q#s/%STARTINCLUDE%/<onlyinclude>/#,
q#s/%STOPINCLUDE%/<\/onlyinclude>/#,

# %REDIRECT%
q@s/%REDIRECT{"$web.(\S+?)"}%.*/"#REDIRECT ".makeInternalLink($1)/e@,
q@s/%REDIRECT{"?(\S+?)"?}%.*/"#REDIRECT ".makeInternalLink($1)/e@,
q@s/%REDIRECT\{"$web.(\S+?)"}%.*/"#REDIRECT ".makeInternalLink($1)/e@,
q@s/%REDIRECT\{"?(\S+?)"?}%.*/"#REDIRECT ".makeInternalLink($1)/e@,
q@s/%REDIRECT.*?%//@,

# Remove some tags with quirky patterns
q#s/%A_\w+%//g#,
q#s/%PARAM\d+%//g#,
q#s/%POS:(.*?)%//g#,
q#s/%SECTION\d+%//g#,
q#s/%TMPL:DEF{.*?}.*?%TMPL:END%//g#,
q#s/%TMPL:DEF\{.*?}.*?%TMPL:END%//g#,
q#s/%TMPL:[A-Z]+(|{.*?})%//g#,

# EfetchPlugin -> Extension:PubmedParser
@@ -731,7 +731,7 @@ sub parseTwikiVars {
while (<TWIKI>) {
if (/\* +Set +$varPattern += +(.*)/) {
setTwikiVar($1,$2);
} elsif (/^%META:PREFERENCE{name="(.+?)".*type="Set".*value="(.*?)"/) {
} elsif (/^%META:PREFERENCE\{name="(.+?)".*type="Set".*value="(.*?)"/) {
setTwikiVar($1,$2);
}
}