mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-01-19 16:49:34 +00:00
simplify regex
This commit is contained in:
parent
02409f467a
commit
8d410c8a57
1 changed files with 1 additions and 1 deletions
|
|
@ -450,7 +450,7 @@ abstract class AbstractParameter extends AbstractNamedDBElement implements Uniqu
|
|||
$unit = $this->unit;
|
||||
} else {
|
||||
//Escape the percentage sign for convenience (as latex uses it as comment and it is often used in units)
|
||||
$escaped = preg_replace('/([^\\\\]?%)/', "\\\\$1", $this->unit);
|
||||
$escaped = preg_replace('/\\\\?%/', "\\\\%", $this->unit);
|
||||
|
||||
$unit = '$\mathrm{'.$escaped.'}$';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue