fixe dlabels

This commit is contained in:
2018-05-18 10:23:31 +02:00
parent e7c589b835
commit 91aaecdb73
24 changed files with 138 additions and 113 deletions
+25
View File
@@ -0,0 +1,25 @@
<?php
if (count($argv)==1) die("no file\n");
foreach($argv as $i => $value) {
if ($i == 0) continue;
if(!file_exists($value)) die("no file ".$value."\n");
}
foreach($argv as $i => $value) {
if ($i == 0) continue;
echo "Cleaning $value\n";
$content = file_get_contents($value);
$pat = '/(\\\\(?:label|cref|Cref|ref))\\{([^}]+)\\}/';
$fixed = preg_replace_callback($pat, function($match) {
return $match[1] . '{' . trim(str_replace('-', '_', $match[2])) . '}';
}, $content);
file_put_contents($value, $fixed);
}
echo "OK.\n";