Skip to content

Commit

Permalink
Update index.php
Browse files Browse the repository at this point in the history
  • Loading branch information
jpadfield authored Oct 2, 2023
1 parent d20e30d commit f98a1b5
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -1373,17 +1373,27 @@ function Mermaid_defThing ($var, $no, $fc=false)
{$usedClasses[$cls] = $allClasses[$cls];}
else //added the option to used custom dashes on the border line initially for subgraphs but also added for nodes - J Padfield 22/6/23
{
if (preg_match("/^(.+)[-]([0-9]+)[-]([0-9]+)$/", $cls, $cm))
{
if (preg_match("/^(.+)[-]fs([0-9]+)[-]*([0-9]*)[-]*([0-9]*)$/", $cls, $cm)
or preg_match("/^(.+)[-]fs([0-9]+)[-]([0-9]+)[-]([0-9]+)$/", $cls, $cm)
or preg_match("/^(.+)[-]*([a-z]*)[-]([0-9]+)[-]([0-9]+)$/", $cls, $cm))
{
if(isset($allClasses[$cm[1]]))
{
$tc = rtrim(trim($allClasses[$cm[1]]), ';');
$tc = preg_replace("/classDef $cm[1]/", "classDef $cls", $tc);
$tc = $tc.",stroke-dasharray:$cm[2] $cm[3];\n";
$allClasses[$cls] = $tc;
{
$tc = rtrim(trim($allClasses[$cm[1]]), ';');
$tc = preg_replace("/classDef $cm[1]/", "classDef $cls", $tc);

if($cm[2])
{$tc = $tc.",font-size:$cm[2]px";}

if($cm[3] and $cm[4])
{$tc = $tc.",stroke-dasharray:$cm[3] $cm[4]";}

$tc = $tc.";\n";

$allClasses[$cls] = $tc;
$usedClasses[$cls] = $allClasses[$cls];
}
}
}
}

$str = "\n$code(\"$var\")\nclass $code $cls;\n".$click;
Expand Down

0 comments on commit f98a1b5

Please sign in to comment.